Input problems

+1 Tomislav Keškić · February 4, 2015
Hey guys I need help! How do I ask for input and if the input is letter it asks again, it has to be a number...I mean I know how scanf works but the problem is I don't know how do I store the input so it can check if its a word/letter or a number

Post a Reply

Replies

Oldest  Newest  Rating
0 Lazar Bulic · February 5, 2015
there is a clever function 


isdigit();


Try to work something out with it :)


Also you can do it "manually" with 


if(){
}


You know where all numbers are in ASCII. Hint: between '0' and '9'.

P.S. these work only if you are checking numbers inputted as characters.
  • 1

C

107,040 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator