write a program 2 input a character and check whether it is a vowel or not with if else
Answers
Answered by
3
Answer:
I am providing the code, hope that runs on your compiler, I use Dev C++.
Programming Language used :- C
#include<stdio.h>
#include<conio.h>
int main( )
{
char alp;
printf("Input an alphabet in lowercase : ");
scanf("%d",alp);
if(alp=='a' or alp=='e')
{
printf ("Entered alphabet/character is a vowel");
}
else if(alp=='i' or alp=='o')
{
printf ("Entered alphabet/character is a vowel");
}
else if(alp=='u')
{
printf ("Entered alphabet/character is a vowel");
}
else
{
printf ("Entered alphabet/character is not a vowel");
}
return 0;
}
Hope it helps : )
Answered by
1
class pro
{ public static void main (char L)
{
if (L==‘a’||L==‘e’||L==‘i’||L==‘o’||L==‘I’)
System.out.println(“it is a vowel”);
else
System.out.println(“it is a consonant “);
}
}
{ public static void main (char L)
{
if (L==‘a’||L==‘e’||L==‘i’||L==‘o’||L==‘I’)
System.out.println(“it is a vowel”);
else
System.out.println(“it is a consonant “);
}
}
Similar questions