Check if the given character is a digit or not

Write a Simple function that accepts a character and return true if it is a digit else return false:

Solution:

bool isDigit(char ch)
{
	return (ch >='0' && ch<='9');
}
The above function is self-explanatory.

0 Comments

Leave a comment