Computer Science, asked by Anonymous, 1 year ago

Difference between


For loop

While loop

Do while loop


Aleast two or two points in each.

# No sparm ans


Anonymous: Nyc.
deveshjat9999: kya kar rahe ho
Anonymous: Kuch nai.
deveshjat9999: or padhai kase chal rahe hai
Anonymous: Badiya.
deveshjat9999: or tumara koi bf hai kya
Anonymous: Nope. I m single
Anonymous: Kk bro.
deveshjat9999: kk sis

Answers

Answered by Anonymous
18
\huge\bold{Answer}

\bold{For\: Loop}

________________________________________

=> 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.

________________________________________

\bold{While\: 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.

_________________________________________

\bold{Do\: while\: 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:

Anonymous: Can u give me the tags plz
Anonymous: Plz.
Anonymous: Hm plz
Anonymous: Np.
Anonymous: U can tell me at any time. When u were free when i came online i will give u reply.
Anonymous: superb answer krish ✔✌♡
Answered by Hacket
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.
Similar questions