while in c programming code example
Example 1: WHILE loop in c
while( a < 20 ) {
printf("value of a: %d\n", a);
a++;
}
Example 2: 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;
}