Answers for "how to check if the variable is not a integer in c"

C
1

check if float is integer c

float f = 4.5886;
if (f == (int)f)
     printf("yesn");
else printf("non");
Posted by: Guest on May-10-2021
0

c check if argument is integer

bool isNumber(char number[])
{
    int i = 0;

    //checking for negative numbers
    if (number[0] == '-')
        i = 1;
    for (; number[i] != 0; i++)
    {
        //if (number[i] > '9' || number[i] < '0')
        if (!isdigit(number[i]))
            return false;
    }
    return true;
}
Posted by: Guest on March-04-2021

Code answers related to "how to check if the variable is not a integer in c"

Code answers related to "C"

Browse Popular Code Answers by Language