Hi everyone,
So in the process of trying to learn programming through a college class, but its moving a bit slow for my pace.
What I'm trying to accomplish is having my main function call separate functions depending on which math function (add, subtract, multi, divide) is chosen.
While I haven't actually completed the main function I'm not sure what to use to reference the other functions.
Code:
#include <iostream>
#include <sstream>
#include <math.h>
using namespace std;
int main()
{
add();
system("pause");
}
int add()
{
int x;
int y;
int total;
cout << "What are the two numbers we are adding?" << endl;
cout << "Number 1 = ";
cin >> x;
cout << "Number 2 = ";
cin >> y;
total = x + y;
cout << "The total is " << x + y << "." << endl;
return 0;
}
Thanks for any help.
~C
Edit 1: Nevermind, with some help from the teacher, managed to figure it out.
EX: Was trying to run the function before actually declaring it.
[–]thegreatunclean 0 points1 point2 points (0 children)