0

Can someone check whts wrong with my program

https://code.sololearn.com/ci7T581tbBBk/?ref=app

9th Mar 2018, 2:53 AM
Hacker 815
2 Respostas
+ 4
You need to assign sum after you get the values of a and b, or you will get a garbage value, as a and b don't have any values till the cin>> operation. Thus, the code will be: #include <iostream> using namespace std; int main() { int a, b; cout << "Please enter 2 numbers \n"; cin >> a >> b ; int sum=a+b; cout << sum ; return 0; }
9th Mar 2018, 2:55 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
0
Tnx
9th Mar 2018, 3:02 AM
Hacker 815