functions

I'm trying to do a + b = Addition

so example 1 + 1 = 2

For some reason its saying 1 + 1 =1?

Can someone tell me what to fix so it works please thanks.

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
  #include <iostream>

using namespace std;

void Start_Program();
int Addition(int,int);


int main()
{
    Start_Program();

    return 0;
}
void Start_Program(){
    int a;
    int b;

    std::cout <<"Start Program input 2 numbers" << endl;
    cin >>a;
    cin >>b;
    std::cout <<a<<"+"<<b<<"="<<Addition<<endl;

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

}

You need to pass a and b to your function call

Addition(a, b)
thanks
Topic archived. No new replies allowed.