prev | Logical OR 20. Vowel or not (30.6.2009) /* Program# 20 date : 25-12-2008 Vowel or Not */ #include <stdio.h> main(){ char a; printf("\nEnter a character :"); scanf("%c",&a); if(a=='a' ||a=='e'||a=='i'||a=='o'||a=='u') printf("\n %c: Vowel",a); else printf("\n %c: Not a vowel",a); } output: Enter a character : p p: Not a vowel Things to note: 1.The single alphabet enclosed in inverted commas is called as character constant. 2.The maximum length is only one character. |
next |