6th Simple C++ Program - Tutorial
By ssendi, 12th Apr 2012 | Follow this author
| RSS Feed | Short URL http://nut.bz/3kr790ky/
Posted in WikinutGuidesTechnologyComputer Software
In this program we use comand while, and we add two numbers that user wants...Intereseting is that user can repeat this operation until he enters 0,as a code for exit....
6th Simple C++ Program - Tutorial
/*
In this program we use comand while, and we add two numbers that user wants...Intereseting is that user can repeat this operation until he enters 0,as a code for exit....
*/
#include <iostream>
using namespace std;
int main()
{
int option=1;
while(option!=0){
int number1;
int number2;
cout<<"Please enter 2 number which you want to add: "<<endl;
cin>>number1;
cin>>number2;
cout<<"When we add these 2 numbers we get: ";
cout<<number1+number2<<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....


Comments