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:
hope more people will read this article keep up the good work The information provided by you is really very good and helpful for me. Keep sharing good information Top Gun Maverick Jacket
ReplyDeleteVery nice Article Keep it up for your good Work Thanks for sharing information The content was really very interesting. I am really thankful to you for providing this unique information You have a good point here! Ranboo Varsity Jacket
ReplyDeleteExtremely go through article. I have never seen such beautiful article. Learn many things from this I hope you continue to have high-quality articles like this to share with everyone! Top Gun Jacket
ReplyDelete