So I have been working on a program that takes two integers and calculates addition,subtraction,multiplication,division, and modular division. So far I think I have everything correct to make it run...I just can't figure out how to rewrite it using functions. Any help would be appreciated. Thank you.
#include<iostream>
using namespace std;
int main()
{
int num1, num2, selection;
cout << "Please enter an integer: ";
cin >> num1;
cout << "Please enter another integer: ";
cin >> num2;
So this is what I have so far, but I'm getting errors that the functions were not declared. Did I declare them wrong or just put them in the wrong place?
int AddNum(int,int);
int SubNum(int,int);
int MultNum(int,int);
double DiviNum(int,int);
int ModNum(int,int);
int main()
{
.....
}
int AddNum(int num1, int num2)
{
...
}
int SubNum(int num1, int num2)
{
...
}
and so on.
remember to include the return type on the prototypes and definitions