C++ for statement loop controlled by int value

Description

C++ for statement loop controlled by int value

#include <iostream>
using namespace std;
int main()//from w w w .  j a va  2  s  .com
{
   int j;                     //define a loop variable
   for(j=0; j<15; j++)        //loop from 0 to 14,
      cout << j * j << "  ";  //displaying the square of j
   cout << endl;
   return 0;
}



PreviousNext

Related