adsense

Hii, welcome to my site. My name is Om prakash kartik. This blog helps you to learn programming languages concepts.

Program in C to check a given character is vowel or consonant Using if else statement

Program in C to check a given character is vowel or consonant Using if else statement




#include<stdio.h>
   int main()
     {
      char ch;
      printf("Enter a character:-");
      ch=getchar();
      if((ch=='A'||ch=='a')||(ch=='E'||ch=='e')||(ch=='I'||ch=='i')||(ch=='O'||ch=='o')||(ch=='U'||ch=='u'))
           printf("%c is vowel.",ch);
      else
     printf("%c is consonant.",ch);
   return 0;
 }
Output:-

 


  Related program :

                                    

  1. Program in C to check a given character is vowel or consonant Using switch case.

Post a Comment

0 Comments