c1

srijeda, 11. travnja 2012.

6. Simple C++ Program - Tutorial


#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;
}

Nema komentara:

Objavi komentar