C++ Program that print 1 to 10 Numbers Using while Loop
#include<iostream>//header file
using namespace std;
int main()//function main
{
int number = 1;//declaration of variable of int type and initialized value 1
while (number <= 10)//while loop
{
cout << number << endl;//print number
number++;//increment 1
}
system("pause");
}
0 comments:
Post a Comment