The general format for a while loop is
while (condition) {
simple or compound statement (body of the loop);
}
#include
main(){
int i = 0;
while (i<5){
printf(" the value of i is %d\n", i);
i = i + 1;
}
}
the value of i is 0
the value of i is 1
the value of i is 2
the value of i is 3
the value of i is 4