6th Simple C++ Program - Tutorial

ssendi By ssendi, 12th Apr 2012 | Follow this author | RSS Feed | Short URL http://nut.bz/3kr790ky/
Posted in Wikinut>Guides>Technology>Computer 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....

Tags

Code, Int, Int Main, Main, Manual, Program, Programmed Specially, Programmes, Programming, Programming In C, Programming Software, Programs, Programs Information, Tutor, Tutor Jobs, Tutorial, Tutorials, Tutoring, Tutoring On The Internet, Tutoring On-Line, Tutors

Meet the author

author avatar ssendi
I'm from Bosnia, and I like computer languages...
On this site I'will mainly write codes for programs, in C++, Java, and HTML...
I also write at http://www.expertscolumn.com

Share this page

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

Comments

Add a comment
Username
Can't login?
Password