0
Why is it not adding?
4 Answers
+ 5
I don't code in c++ but I tweaked your code.
https://code.sololearn.com/cDVXaMdEVRNk/?ref=app
+ 3
#include <iostream>
using namespace std;
int addition( int x, int y );
int main(){
int x,y;
cout<< "Enter the first digit!"<<endl;
cin>>x;
cout<< "Enter the second digit!"<<endl;
cin>>y;
cout<< "The sum of the digits is "<< addition(x, y) << endl;
return 0;
}
int addition(int x, int y){
int sum = x + y;
return sum;
}
+ 1
... "undefined reference to "addition()' "
There is no function called "addition" in your program that takes no parameters.
0
So how do i fix it?