While Loop in C++

While Loop in C++

Version
Download 10
Total Views 0
Stock
File Size 1.29 KB
File Type zip
Create Date May 9, 2016
Last Updated May 9, 2016
Download

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;
}

Comments

comments

Leave a Reply

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

*