cant get the answer ..when i run it just returns enter frst nmber enter second number and the sum is..... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

cant get the answer ..when i run it just returns enter frst nmber enter second number and the sum is.....

#include <iostream> using namespace std; main() { int a,b,c; cout<<"Enter first number"; cin >> a; cout<<"Enter second number"; cin >> b; c =a+b; cout<<"The sum is<< c"; }

7th Jul 2016, 3:31 PM
Syed Aman
Syed Aman - avatar
2 Answers
+ 1
#include <iostream> using namespace std; int main() { int a,b,c; cout<<"Enter first number\n"; cin >> a; cout<<"Enter second number\n"; cin >> b; c =a+b; cout<<"The sum is "<<c; return 0; } you had the variable c in the string rather than actually calling it's value
7th Jul 2016, 4:16 PM
destro
0
tnks it works fine now
7th Jul 2016, 5:34 PM
Syed Aman
Syed Aman - avatar