answersLogoWhite

0


Best Answer

If the character's ASCII value is in the range of the digit characters, then it is a numeric. In ASCII, the range of digits is from '0' to '9' (48 to 57 decimal). Note that character constants such as '0' will implicitly convert to the constant integer 48 (the ASCII code for the character) so there is no need to remember the actual value; the compiler can determine this for us.

The following function shows how one might test a character to see if it is a digit or not:

bool is_digit (const char c) {

return (c>='0' && c<='9');

}

The function will return true if the given character is a digit, otherwise it will return false.

User Avatar

Wiki User

8y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you check whether a character is numeric in an alphanumeric field in C?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How to check whether a character is numeric in an alphanumeric field in easytrieve.?

IF WS-AGE NUMERIC DISPLAY "NUMERIC" ELSE DISPLAY "NOT NUMERIC' END-IF


Which function can be used to check whether the value is numeric or not?

In Excel you can use the ISNUMBER() function.


How many digits make up an international bank account number?

There are: IBAN header - 2 alpha characters + 2 digit check digit Bank code - 4 alpha characters Sort code - 6 digits Account number - 8 digits Making a total of 22 alphanumeric characters (of which 16 are [numeric] digits).


How do you check whether we are lack of oxygen?

We can check by breathing and we will feel difficult to breathe then this is how we check whether we are lack of oxygen.


What would i do to help me determine if something is metal?

Check the conductivity. Check whether it is lustrous. Check whether it is malleable.


Have mineral crystals arranged in bands?

Yes. The most extreme examples of this would be the micas, and perhaps graphite. You may like to check whether talc also has this character.


Write a program to adentify whether a character entered by a user is a vowel or a consonant?

You can check the value of a character by using if statements.Also, note that this code does not check for capital letters./* code */#include int main(){char c;c = getc(stdin);if (c 'o') {/* If the character is a vowel, this code will be executed. */} else if (c >= 'a' && c


What are the explanation steps for palindrome program?

If you want to check whether a string is a palindrome, you can reverse the string (for example, the Java class StringBuffer has a reverse() method), and then compare whether the two strings - the original string and the reverted string - are equal. Alternately, you could write a loop that checks whether the first character of the string is equal to the last one, the second is equal to the second-last one, etc.; that is, you have a counter variable (in a "for" loop) that goes from zero to length - 1 (call it "i"), and compare character #i with character #(length-i-1) inside the loop.


I looking for vin check up for car whether it was flooded or not?

I am looking for a vin check up fro a car whether it was flooded or not flooded check up


How do you check whether your new N96 is original Nokia Finland?

How do you check whether your new N96 is original Nokia Finland?


How do you know that a numeric is palindrome or not using c or pascal language?

Reverse the digits then check of the new number is the same as the original number.


How do you write 15000 in numeric number?

Fifteen thousand. If you are writing a check it would be fifteen thousand and 00/100 dollars