For Loop in C++

Download
Download is available until [expire_date]
  • Version
  • Download 13
  • File Size 1.27 KB
  • File Count 1
  • Create Date April 17, 2016
  • Last Updated April 18, 2016

For Loop in C++

For Loop in C++

For loop demo in c++. The program will ask you to enter a number of how many times you want hello world to display on the screen. The number entered will then process and executed in the for loop.

Happy programming!

Source code:

#include < iostream >

using namespace std;

int main()
{
    int number=0;
    cout << "enter number of how many hello world you want to display: " << endl;
    cin >> number;

    for ( int i=0; i < number; i++)
    {
    cout << "Hello world!" << endl;
    }
    return 0;
}
, , , , , ,

Post navigation

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.