The do statement is used to declare a do-while loop. A do-while loop is a loop that executes once, and then checks it’s condition to see if it should continue through the loop. After the first iteration, it will continue to execute the code while the condition is true.

Below is the C program to demonstrate a do-while loop.


#include <stdio.h>
int main() 
{
  int i = 1;
  do {
    printf("%d ", i);
    i++;
  } while(i <= 5);
  
  return 0;
}
Output
1 2 3 4 5