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

25th Jun 2022, 7:55 PM
Chike Chewakondi
5 odpowiedzi
+ 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.
25th Jun 2022, 8:43 PM
Chris Coder
Chris Coder - avatar
+ 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
26th Jun 2022, 1:08 AM
Arsenic
Arsenic - avatar
0
https://code.sololearn.com/cbn5meiBk8IV/?ref=app
25th Jun 2022, 8:11 PM
Chike Chewakondi
0
Here sir
25th Jun 2022, 8:11 PM
Chike Chewakondi
0
Doesn't work so well, have difficulties in copying my code there
25th Jun 2022, 8:25 PM
Chike Chewakondi