do while en c code example
Example 1: c do while
do {
// code
} while(/* condition */);
Example 2: do-while in c
#include
int main()
{
int j=0;
do
{
printf("Value of variable j is: %d\n", j);
j++;
}while (j<=3);
return 0;
}
Example 3: do while loop in c
//This program stops when a number greater than 10 is printed and prints that, value greater than 10
#include
main()
{
int a;
do
{
printf("\nEnter your value: ");
scanf("%d", &a);
} while (a<10);
printf("Value greater than 10");
}