Why is it not adding? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
27th Dec 2018, 5:52 PM
Jeremy Cruz
Jeremy Cruz - avatar
4 Answers
+ 5
I don't code in c++ but I tweaked your code. https://code.sololearn.com/cDVXaMdEVRNk/?ref=app
27th Dec 2018, 6:42 PM
Lambda_Driver
Lambda_Driver - avatar
+ 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; }
27th Dec 2018, 6:35 PM
Izaak GOLDSTEIN
Izaak GOLDSTEIN - avatar
+ 1
... "undefined reference to "addition()' " There is no function called "addition" in your program that takes no parameters.
27th Dec 2018, 6:17 PM
Kirk Schafer
Kirk Schafer - avatar
0
So how do i fix it?
27th Dec 2018, 6:21 PM
Jeremy Cruz
Jeremy Cruz - avatar