Simple Adder


SimpleAdder.cpp

Program listing

/************************************************************************
*                                                                       *
*    Program:    Simple Adder                                           *
*                                                                       *
************************************************************************/

#include <iostream>
#include <string>

using namespace std;

int main() {
    int a = 10;
    int b = 20;
    int c = a + b;
    cout << "The sum is " << c << endl;
    return 0;
}

Sample run

The sum is 30
			


Previous example
Next example

e-mail me at robbk@hsc.edu

This page was last modified on Sep. 7, 1998

URL: http://people.hsc.edu/faculty-staff/robbk/Coms261/Examples/SimpleAdder.html

Return to Coms 261 home page