Computer Science, asked by 01panyang2018, 2 months ago

difference between do while and for loop in ''C"​

Answers

Answered by seematarkunde0
1

Answer:

for loop:

for loop provides a concise way of writing the loop structure. Unlike a while loop, a for statement consumes the initialization, condition and increment/decrement in one line thereby providing a shorter, easy to debug structure of looping.

Syntax:

for (initialization condition; testing condition;

increment/decrement)

{

statement(s)

}

Answered by vermanushka7487
1

Answer:

In while loop if initialization is done during condition checking, then initialization is done each time the loop iterate. In 'for' loop iteration statement is written at top, hence, executes only after all statements in loop are executed. In 'while' loop, the iteration statement can be written anywhere in the loop.

Similar questions