Question : c string is int
Answered by : distinct-dog-4jhsfbxh3ii1
int isNumber(char s[])
{ for (int i = 0; s[i]!= '\0'; i++) { if (isdigit(s[i]) == 0) return 0; } return 1;
}
Source : | Last Update : Sun, 01 Nov 20
Question : c check if character is a digit
Answered by : dark-dugong-1jwlih6ugr8v
char ch = '1';
if(isdigit(ch)) printf("numeric");
else printf("alphabet" ); // output: numeric
CCopy
Source : https://iq.opengenus.org/character-in-c/ | Last Update : Wed, 13 Apr 22