What is the output of the program: while loop - C++ Statement

C++ examples for Statement:while

Description

What is the output of the program: while loop

Demo Code

#include <iostream>
using namespace std;
int main()// ww w. j a v a  2 s  .  c o m
{
   int i;
   i = 10;
   while (i >= 1)
   {
      cout << i << "  ";
      i--;            // subtract 1 from i
   }
   return 0;
}

Result


Related Tutorials