while loop in c code example
Example 1: for loop in c
int i;
for (i = 0; i < n; ++i) { // n is the number of iterations
// Code here
}
Example 2: c++ while true loop
while (true) { // you can also put 1 or true: while (1)
//do stuff
}
Example 3: WHILE loop in c
while( a < 20 ) {
printf("value of a: %d\n", a);
a++;
}