Contact Learn C
Copy

Program 31:To know whether the character is vowel or not

Program 31:
 
#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:
  1. The program starts with initializing :
    • c → To store Input character
  2. 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)
  3. 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.
  4. 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:

To know whether the character is vowel or not


3 comments:

  1. 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

    ReplyDelete
  2. Very 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

    ReplyDelete
  3. Extremely 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

Donate

Download App and Learn when ever you want

Get it on PlayStore
Get it on Amazon App Store
Get it on Aptoide