difference between
Nested if and nested loop
Break and continue
Answers
Answer:
Differentiate between the following
Question 1
Nested if and nested loop
Nested if is used to do conditional checks at multiple levels whereas nested loops are used to execute one iterative set of statements inside another iterative set.
Question 2
Break and continue
break statement is used to unconditionally jump out of the loop whereas continue statement is used to unconditionally jump to the next iteration of the loop, skipping the remaining statements of the current iteration.
break statement is used in switch-case and loops whereas continue statement is only used in loops.
Answer:
Nested if is used to do conditional checks at multiple levels whereas nested loops are used to execute one iterative set of statements inside another iterative set.