Search
 
SCRIPT & CODE EXAMPLE
 

C

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 Vowel
", ch);
    }
    else
    {
        printf("%c is consonant
", ch);
    }
    return 0;
}
Comment

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: 
");
    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 vowel
", letter);
        }
        else
        {
            printf("The letter that you have entered (%c) is a consonant
", letter);
        }
    }
    else
    {
        printf("You didn't enter any letter
");
    }
    system("pause");
    return 0;
}
Comment

vowel and consonant identification in c

if(ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') {  
     printf("%c is vowel
", ch);  
 }  
 else {  
     printf("%c is consonant
", ch);  
 }
Comment

PREVIOUS NEXT
Code Example
C :: Using PostgreSQL array to store many-to-many relationship using sqlalchemy 
C :: simplify fractions C 
C :: data types in c 
C :: how to get user input in c 
C :: c printf to string 
C :: size of an array c 
C :: remove element from np array 
C :: successeur nombre chaine 
C :: multiplication of two matrix in c 
C :: how to get add to number C 
C :: merge sort code c 
C :: concatenate char * c 
C :: printf type format 
C :: how to combine strings in c 
C :: pg_restore: error: input file appears to be a text format dump. Please use psql. 
C :: pthread c 
C :: dynamic memory in c 
C :: c print to stderr 
C :: what is string::npos 
C :: typescript class as function parameter 
C :: c/c++ windows api download file 
C :: Passing a matrix in a function C 
C :: c typedef 
C :: Palindrome number in c program 
C :: c change value of const 
C :: how to sort an int array in c 
C :: why do you jerk while falling aslee 
C :: how to check the word is present in given char array in c 
C :: c malloc array 
C :: objects in oops 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =