do while(1) loop in c code example
Example 1: c do while
do {
// code
} while(/* condition */);
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;
}
Example 3: infinite loop using while
infinite loop using 'while'loop ----> while(1)