+ 1
I don't know what is wrong with these code can any one help me with that .....
Can any one help me with these swite condition Everything is almost right but something is wrong with these https://code.sololearn.com/cmpnOKhQc6e3/?ref=app https://code.sololearn.com/cmpnOKhQc6e3/?ref=app
7 ответов
+ 4
What are your inputs? sample!!?
edit: Rustam Singh Sahu
before scanf for char, just put getchar(); to consume white space.....
+ 3
Andrés Sebastián López You can, you just need to make sure they're all on a seperate line such as by pressing the enter key after each input.
+ 1
I tried it to many c compiler but output is wrong btw I'm beginner thanks for the help
0
Justice, I had never realized that..
Thanks!!
0
Andrés Sebastián López No problem! The same happened with me. It's very different from typical IDE behavior when using the command line.
0
c code really works in a stream though. So you can enter as many inputs needed on one line as long as the scan is correct. or use jaykrishna's getchar() suggestion. But i just tried
and input: 2 3+
and it worked just fine. Notice how there's no white space in between the second number and the operator
- 1
Are you trying to run it in the Sololearn app?
I don't know if you could do this because the app doesn't let you introduce more than one input, at least when I tried to do a program with multiple inputs, I couldn't test it..