Where am i going wrong with this? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Where am i going wrong with this?

I could not get the desired output. Everytime it shows the same meaningless output irrespective of the input. Pls hlp. https://code.sololearn.com/chS3eMHz8XD2/?ref=app

16th Jul 2017, 7:00 AM
Vijaya Vignesh
Vijaya Vignesh - avatar
3 Answers
+ 7
a + b have no real values assigned to them when you are using them. this needs to be moved to a place after you get input from the user i.e int a, b; cin >> a; cin >> b; int sum = a + b;
16th Jul 2017, 7:03 AM
jay
jay - avatar
+ 2
@jay Thanks for the help!
16th Jul 2017, 7:07 AM
Vijaya Vignesh
Vijaya Vignesh - avatar
+ 2
It worked after moving!
16th Jul 2017, 7:11 AM
Vijaya Vignesh
Vijaya Vignesh - avatar