while en C code example
Example 1: boucle for c
int compteur;
for (compteur = 0 ; compteur < 10 ; compteur++)
{
printf("Salut les Zeros !\n");
}
Example 2: c do while
do {
// code
} while(/* condition */);
Example 3: WHILE loop in c
while( a < 20 ) {
printf("value of a: %d\n", a);
a++;
}
Example 4: do-while in c
#include <stdio.h>
int main()
{
int j=0;
do
{
printf("Value of variable j is: %d\n", j);
j++;
}while (j<=3);
return 0;
}
Example 5: how to do a while true in C
for(;;) {
...
}