0
Could you help explain the error in my code
There's a part where the operator is to be scanned but that part is skept when running the code, and l can identify what could be the cause of that
5 ответов
+ 1
Hi i'm going to delete my comments so someone may be able to help you better. Leave your code up for others to see.
+ 1
I think the problem is due to the fact that unlike other format specifiers, the character format "%c" doesn't make scanf() to skip whitespace ( newline character, space character and tab character ) inside input buffer.
Try replacing
scanf("%c", &operator);
With ( notice the space before %c )
scanf(" %c", &operator);
And check if it fixed the issue or not
https://code.sololearn.com/cKCBmmSPm5V9/?ref=app
0
https://code.sololearn.com/cbn5meiBk8IV/?ref=app
0
Here sir
0
Doesn't work so well, have difficulties in copying my code there