how i can change this code from for loop to while loop in C program?

A for loop for(init; cond; step) { loop-body; } is equivalent to:

init;
while(cond)
{
     loop-body;
     step;
}

Leave a Comment