Noob question function not being read.
Why wont this code work? Sorry im so nooby. Everything inside my addition function is not being read inside my main function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#include <iostream>
#include <limits>
using namespace std;
void additionFunction();
int main()
{
additionFunction();
cout << ("Enter addition");
cin >> a;
cout << ("Enter addition");
cin >> b;
cout << "The answer is " << answer << endl;
return 0;
}
void additionFunction(){
int a;
int b;
int answer = a + b;
return answer;
}
|
aaaa ok thanks
Topic archived. No new replies allowed.