This program accepts a character and check whether entered character is vowel or not using switch statement.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #include "conio.h" #include "stdio.h" void main() { char ch; printf("\nEnter a charecter to check "); scanf("%c",&ch); switch(ch) { case 'a': printf("\nThe entered charecter %c is a vowel",ch); break; case 'e': printf("\nThe entered charecter %c is a vowel",ch); break; case 'i': printf("\nThe entered charecter %c is a vowel",ch); break; case 'o': printf("\nThe entered charecter %c is a vowel",ch); break; case 'u': printf("\nThe entered charecter %c is a vowel",ch); break; default: printf("\nThe entered is a consonant"); } getch(); } |
Output:
Enter a charecter to check i The entered charecter i is a vowel |
Description :
This is the one stop educational site for all Electronic and Computer students. If you want to learn something new then we are here to help. We work on Microcontroller projects, Basic Electronics, Digital electronics, Computer projects and also in basic c/c++ programs.
#Home #Sitemap #Resources #Terms of Use
Copyright©2012 electrofriends.com All Rights Reserved
Contact:info@electrofriends.com