0

enter image description here

Even doing c char and int operating then why first we get the int value and put the "enter" enter also get the charcter.why is it?

i just want to know why it is goes to like that.

Peter Haddad
  • 78,874
  • 25
  • 140
  • 134
  • `scanf` puts decimal `10` (which is '\n'), then you sum `12` and `10` (as `char` is a normal integer type) and you get `22` – 0___________ Jan 26 '23 at 12:26
  • @Pathum Lakshan Use scanf( " %c", &c ); Pay attention to the leading space in the format string. It allows to skip white space characters. – Vlad from Moscow Jan 26 '23 at 12:26
  • Please always add text (code, error messages, input and output) as formatted text in your question. Don't show pictures as we cannot copy&paste them into the compiler. – Gerhardh Jan 26 '23 at 12:31

0 Answers0