Do they mean the Hex number for the ASCII character 0-9?

  • Thread starter Thread starter vladittude0583
  • Start date Start date
  • Tags Tags
    Mean
vladittude0583
Messages
40
Reaction score
0
Hey guys, I need a little bit of help understanding this question and writing the code for it:

Write the code to count the number of decimal digits (0-9) input from the keyboard until the user presses '\n' and then display this count on the monitor (Declare necessary variables)

Regarding the decimal digits, do they mean the Hex number for the ASCII character 0-9? Could you please clarify this for me? Thanks.
 
Physics news on Phys.org
i'm pretty sure they mean the ascii code for characters 0-9. (without looking)i believe all the ascii characters with values 0 through 9 are non-printing and can't be entered from the keyboard without a combination of keypresses (alt codes). whether you look at them as hex is up to you.
 
You need to take in the input as a string, examine each string character individually and write a function to determine if the character examined is 0-9. You know what to do from here, right?
 

Similar threads

Replies
11
Views
5K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
7K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
1
Views
3K
  • · Replies 15 ·
Replies
15
Views
2K
Replies
1
Views
2K