0
Mistake in this program
#include <iostream> using namespace std; int main() { int a; int b; int sum; cout << "Enter a number \n"; cin >> a; cout << "Enter another number \n"; cin >> b; sum = a + b; cout << "Sum is: " << sum << endl; return 0; }
7 odpowiedzi
+ 4
Code Playground on sololearn disables getting more than one input. Try this on an IDE and it will work fine.
+ 2
"PlayGround Code" Makes you to separe your imputs with spaces, and imput them all together once.
In a console that would be diferent.
Try putting
1
2
and it will works.
0
I don't see anything wrong
0
just once run it
0
you have to enter both the number at the same time in two lines. the code playground cannot accept inputs more than once
0
can we put the sum and also the same line
0
means int (a, b, sum);