4th C++ Simple Program - Tutorial
By ssendi, 12th Apr 2012 | Follow this author
| RSS Feed | Short URL http://nut.bz/26cpib6e/
Posted in WikinutGuidesTechnologyComputer Software
In this program user types two numbers, and program writes on the screen the numbers between those two....
4th C++ Simple Program - Tutorial
/*
In this program user types two numbers, and program writes on the screen the numbers between those two....
here we use comand "for" it made of few parts
for(initial state;condition;step){
--------;
}
*/
#include <iostream>
using namespace std;
int main()
{
int number1;
int number2;
cout<<"Please enter first number: ";
cin>>number1;
cout<<"Please enter last number: ";
cin>>number2;
cout<<"Now we will write all numbers between First and the Last number: "<<endl;
cout<<"Number are: ";
for(int i=number1+1;i<number2;i++){
cout<<i<<", ";
}
cout<<endl<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
Here you can find more C++ programs...
Comments
29th Jun 2012 (#)
Thank you for sharing.:)
Reply to this comment