-7

I'm new to programming, trying to learn C. The program below is showing no signs of error still the output is not correct. I tried it without using '&' sign as "ms" and "sc" are characters but still that doesn't work. What am I doing wrong?

enter image description here

enter image description here

  • 3
    Please do not post images of code. Post text *as* text. Please read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) – Oka Oct 07 '21 at 18:55
  • 1
    `scanf("%c,&ms")` --> `scanf(" %c", &ms);`; same for `&sc`. The arguments should not be *inside* the string. Please turn up your compiler warnings (`gcc -Wall ...`). – Oka Oct 07 '21 at 18:56

1 Answers1

0

the problem is that you missed enclosing quotation marks in the scanf call

replace the following

line 5: scanf("%c",&ms)

line 7: scanf("%c",&sc)
Amir Rasti
  • 706
  • 7
  • 19