Answers for "is vowel function in c"

C
0

vowel or consonant in c

// vowel or consonant check program
#include <stdio.h>
int main()
{
    char ch;
    ch = getchar();
    if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
    {
        printf("%c is Voweln", ch);
    }
    else
    {
        printf("%c is consonantn", ch);
    }
    return 0;
}
Posted by: Guest on July-08-2021
0

vowel and consonant C

//vowel or consonant check program in C using only the if
#include <stdio.h>
#include <stdlib.h>

int main()
{
    char letter;

    printf("Enter a letter: n");
    scanf("%c", &letter);

    if (letter >= 65 && letter <= 90 || letter >= 97 && letter <= 122) //this line check if you have entered a letter based on the ascii chart
    {
        if (letter == 'a' || letter == 'A' || letter == 'e' || letter == 'E' || letter == 'i' || letter == 'I' || letter == 'o' || letter == 'O' || letter == 'u' || letter == 'U')
        {
            printf("The letter that you have entered (%c) is a voweln", letter);
        }
        else
        {
            printf("The letter that you have entered (%c) is a consonantn", letter);
        }
    }
    else
    {
        printf("You didn't enter any lettern");
    }
    system("pause");
    return 0;
}
Posted by: Guest on October-07-2021

Code answers related to "C"

Browse Popular Code Answers by Language