C++ for statement loop control variable inside for statement

Description

C++ for statement loop control variable inside for statement

#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

int main(int nNumberofArgs, char* pszArgs[])
{
    int nLoopCount;
    cout << "Enter loop count: ";
    cin  >> nLoopCount;/*from   w w w . j  a  va  2s. c  om*/

    for (int i = 1; i <= nLoopCount; i++)
    {
        cout << "We've finished " << i << " loops" << endl;
    }
}



PreviousNext

Related