While Loop

Source

#include <iostream>
using namespace std;

int main()
{
   int x = 0;

   do
   {
      cout << "x: " << x << endl;
      x++;
   } 
   while ( x < 10);

  return 0;
}

Output


x: 0
x: 1
x: 2
x: 3
x: 4
x: 5
x: 6
x: 7
x: 8
x: 9