Program 31:
Output:
#include<stdio.h>
main()
{
char c;
printf("Enter a character to know whether it is vowel or not\n");
scanf("%c",&c);
if(c=='A'||c=='a'||c=='e'||c=='E'||c=='I'||c=='i'||c=='O'||c=='o'||c=='U'||c=='u')
printf("The character %c is vowel\n",c);
else
printf("The character %c is not vowel\n",c);
}
Explanation:- The program starts with initializing :
- c → To store Input character
-
printf("Enter a character to know whether it is vowel or not\n"); scanf("%c",&c);Taking input from user.If the input is A(say) -
if(c=='A'||c=='a'||c=='e'||c=='E'||c=='I'||c=='i'||c=='O'||c=='o'||c=='U'||c=='u') printf("The character %c is vowel\n",c); else printf("The character %c is not vowel\n",c);This is the main logic of the program.The input given by user is verified with all the conditions in if part. - As we have given A as input then it will check with A,a,e,E,...u,U.And if any one of the character is equal to input then it is vowel else not
Output:





