Difference between
For loop
While loop
Do while loop
Aleast two or two points in each.
# No sparm ans
Anonymous:
Nyc.
Answers
Answered by
18
________________________________________
=> This loop is so flexible to write an initiation , test condition , update sections all are written after "For" keyword.
=> This loop is an entry control loop.
________________________________________
________________________________________
=> while loop has only test condition after keyword while and initiation before it and update section inside the loop.
=> This loop is also an entry control loop.
_________________________________________
_________________________________________
=> Do while loop is different from other loops because it is an exit control loop.
=> This loop has update section inside it and test condition after keywords do while..
__________________________________________
HOPE IT HELPS YOU ツ
Attachments:
Answered by
5
1 for loop: this loop is more flexible to write as initiation, test condition, update section all are written after ‘for’ keyword.
This loop is an entry control loop that means for every iteration it checks the condition , if the condition is true then only it executes.
2. while loop: This loop is also an entry control loop as same as for loop.
But while loop has only test condition after keyword while and initiation before it and update section inside the loop.
3 do while loop: This loop has some different structure when we compare to both for and while loops.
do while loop is an exit control loop that means it executes the body of the loop then it will check for the condition. This loop has update section inside it and test condition after key words do while.
This loop is an entry control loop that means for every iteration it checks the condition , if the condition is true then only it executes.
2. while loop: This loop is also an entry control loop as same as for loop.
But while loop has only test condition after keyword while and initiation before it and update section inside the loop.
3 do while loop: This loop has some different structure when we compare to both for and while loops.
do while loop is an exit control loop that means it executes the body of the loop then it will check for the condition. This loop has update section inside it and test condition after key words do while.
Similar questions