C Programming Tutorial

Advertisements

Write program to check whether the given character is vowel or not in C



       #include<stdio.h>
       #include<conio.h>
       void main()
       {

              char ch;
              clrscr();
              
              printf("\nEnter any character : ");
              scanf("%c",&ch);
              
              if(ch=='a' || ch=='e' || ch=='i' || ch=='o' || ch=='u' || ch=='A' || ch=='E' || ch=='I' || ch=='O' || ch=='U' )
                     printf("\nThe given character is vowel.");
              else
                     printf("\nThe given character is not vowel.");

              getch();
       }
       
   Output : 

              Enter any character : U
              The given character is vowel.




Advertisement