7th Simple C++ Program - Tutorial

ssendi By ssendi, 12th Apr 2012 | Follow this author | RSS Feed | Short URL http://nut.bz/18-b_sx8/
Posted in Wikinut>Guides>Technology>Computer Software

In this program user types teo numbers and program puts on the screen all even numbers between these two numbers....

7th Simple C++ Program - Tutorial

/*

In this program user types teo numbers and program puts on the screen all even numbers between these two numbers....

*/

#include <iostream>
using namespace std;
int main()
{
int option=1;
while(option!=0){
int number1;
int number2;
cout<<"Please enter 2 numbers: "<<endl;
cin>>number1;
cin>>number2;

cout<<"All even numbers between these two numbers are: ";
for(int i=number1+1;i<number2;i++){
if(i%2==0){
cout<<i<<", ";
}}
cout<<endl<<endl;
cout<<"To exit type 0 , if you want to try again type any other number:";
cin>>option;
cout<<endl<<endl;
}
cout<<endl<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}


Here you can find more C++ Programs....

moderator Steve Kinsman moderated this page.
If you have any complaints about this content, please let us know

Comments

author avatar Denise O
29th Jun 2012 (#)

I am just supporting you with your (apparent) expertise, as I have no idea what this means. Sorry, this is not a dig but, to be honest...
When the hubby is working on a car, I am like 'Duh!' with that also. LOL
THank you for sharing.:)

Reply to this comment

Add a comment
Username
Can't login?
Password