Check If String Is Number C

[Solved] Check If String Is Number C | Basic - Code Explorer | yomemimo.com
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

Answers related to check if string is number c

Code Explorer Popular Question For Basic