C++ | add()

/ 22 Sept 2013 /
Yup, C++, why not C? Because it was boring, for me, I'm enjoying C++ much better, and going to attempt the famous pythagorus calculator for my next program, just as soon as I learn the sqrt() and the pow() functions, unless that's just what they are, then ha.



#include <iostream>
using namespace std;

int add(int a, int b){
 return a + b;
}

int main()
{
 int a, b;
 cout << "Enter first number: "; cin >> a;
 cout << endl << "Enter second number: "; cin >> b;
 cout << endl << "The answer is " << add(a, b) << endl;
 return 0;
}
 
Copyright © 2010 M(ath)+me, All rights reserved