While Loop in C++

Download
Download is available until [expire_date]
  • Version
  • Download 30
  • File Size 1.29 KB
  • File Count 1
  • Create Date May 9, 2016
  • Last Updated May 9, 2016

While Loop in C++

While Loop in C++

Another loop in c++ or in any programming languages is the while loop. This kind of loop will just repeat the line of codes in a number given in the expression.

The discussion and the step by step tutorial will be posted on inettutor.com.

Source code:

#include < iostream >

using namespace std;

int main()
{
    int startingnum, endingnumber;
    cout << "start number with: " << endl;
    cin >> startingnum;
    cout << "end number with: " << endl;
    cin >> endingnumber;
    cout << "-------------" << endl;
    while(startingnum <= endingnumber)
    {
        startingnum++;
        cout << startingnum << 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.