Simple Adder


Program Listing

SimpleAdder.cpp

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

#include <iostream>
#include <string>

using namespace std;

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

Sample Run

The sum is 30



Return to Lectures page


e-mail me at robbk@hsc.edu

This page was last modified on Tue Dec 7 16:04:21 1999 .

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

Return to Coms 261 home page