While Loop in C++

While Loop in C++

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

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)
        cout << startingnum << endl;
    return 0;



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.