Friday, November 3, 2017

Addition of Two Numbers in C++

A simple program of adding the sum of two numbers that I wrote using C++.

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental is (034) 4335675.


Program Listing

#include <iostream>
#include <string>
#include <stdlib.h>


using namespace std;


main() {

    int sum=0,a=0,b=0;
    char reply;

do {
    system("cls");
    cout << "\t\t Addition of Two Numbers";
    cout << "\n\n";
    cout << "Enter the first value  : ";
    cin >> a;
    cout << "\n";
    cout << "Enter the second value : ";
    cin >> b;
    cout << "\n\n";
       sum =(a+b);
    cout << "The sum of " << a <<" and "
    <<b << " is " << sum <<".";
    cout << "\n\n";
    cout << "Do you want to continue y/n : ";
    cin >> reply;
    if (toupper(reply) == 'N') {
        cout << "\n\n";
        cout << "\t\t Thank You For Using This Software !!!";
        break;
    }
    } while (toupper(reply!='Y'));
    cout << "\n\n";
    system("pause");

}




No comments:

Post a Comment