+ 1

What's wrong with this code?

#include <iostream> using namespace std; int main() { int a,b,c; cout <<"This is my calculator:"; cout <<"Enter a:" ; cin >> a; cout <<"Enter b:" ; cin >> b; c=a+b; cout<< "sum is:" <<c; return 0; }

20th Feb 2017, 6:27 AM
Moein Mirghaderi
Moein Mirghaderi - avatar
7 Respostas
+ 3
@Mario Laurisch the request for input before showing output is a bug in code playground.❓❓❓ Try using other online compilers.It isn't a bug. Online compilers work in this way. For dynamic inputs like a statement is outputted and then you are required to input use offline compilers
20th Feb 2017, 9:14 AM
Megatron
Megatron - avatar
+ 2
enter two numbers in separate lines. the request for input before showing output is a bug in code playground.
20th Feb 2017, 6:47 AM
Mario L.
Mario L. - avatar
+ 1
nothing. it works.
20th Feb 2017, 6:44 AM
Mario L.
Mario L. - avatar
+ 1
solo learn asks me inputs before I run the code what shall I enter?
20th Feb 2017, 6:45 AM
Moein Mirghaderi
Moein Mirghaderi - avatar
0
You should write value of a in first li e and in second value of b, cause their compiler wont prompt at the execute time.
20th Feb 2017, 6:49 AM
Ladislav Milunović
Ladislav Milunović - avatar
0
It works well There is no error in the code For multiple inputs we should mention the values separately
20th Feb 2017, 4:56 PM
R.Divyashree
R.Divyashree - avatar
0
It works. Maybe the problem is with the compiler. Which compiler do you use?
19th Nov 2017, 6:36 AM
Dilshodjon Olimov
Dilshodjon Olimov - avatar