C Program To Check the Entered Letter Is Lower Case Or Not

C Program To Check the Entered Letter Is Lower Case Or Not

Code
// C Program To Check the entered letter is lowercase or not...

#include <stdio.h>

int main()
{
    // 97-122 = ASCII Values
    char ch;
    printf("Enter the character\n");
    scanf("%c", &ch);
    if (ch <= 122 && ch >= 97)
    {
        printf("It is lower case\n");
    }
    else
    {
        printf("It is not lower case\n");
    }
    return 0;
}
Output
Enter the character
y
It is lower case

Post a Comment