For Loop
|
While Loop
|
In for loop Initialization condition test and increment/ decrement likes same line.
|
In while first Initialization then condition and last increment/decrement in different line.
|
It syntax easy for write code.
|
It syntax complex to write code.
|
Syntax: for(i=0; i<10; i++)
{ printf("%d\t", i);}
|
Syntax: i=0;
while(i<0)
{ printf("%d\t", i);
i = i+1;}
|
Comments
Post a Comment