PLEASE Help me! C scanf | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

PLEASE Help me! C scanf

I need to create a code that reads a character from the keyboard and returns its value as a number (ASCII table). When I use the printf to print the char input as %d, I have the number, but that's not what I need. I need to read the character as a number and address it to an int variable to compare the value to know if the user typed a letter or a number. Somebody help me, PLEASE!

29th Aug 2020, 12:22 AM
Tamara Raquel da Silva
Tamara Raquel da Silva - avatar
3 Answers
29th Aug 2020, 12:34 AM
Rowsej
Rowsej - avatar
+ 2
No worries Tamy 😝!
29th Aug 2020, 12:39 AM
Rowsej
Rowsej - avatar
+ 1
YES Rowsej ☺️☺️☺️ Thank you so much!
29th Aug 2020, 12:37 AM
Tamara Raquel da Silva
Tamara Raquel da Silva - avatar