Acc to syntax “while” condition is true then control will pass within the body.
After execution of the body once again control will pass back to the condition and until the condition because false body will be repeated n no.of times.
When the condition becomes false, then control will pass outside of the body, if condition is not false, then it becomes an infinite loop.
Void main ( )
{
Int I;
I=j;
While (i<=10)
{
Print f (“% d”, i);
I = i+2;
}
}
O/p: 1 3 5 7 9