Answer to Question #73087 in C for tilu

Question #73087
c program for vowel or not
1
Expert's answer
2018-02-01T05:18:01-0500

#include <stdio.h>
#include <ctype.h>

int main()
{
char ch;

printf("Please enter a letter (0-end): ");
scanf("%c", &ch);

if (!isalpha(ch)) {
printf("Not a letter\n");
}
else
{
if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' || ch == 'y'
|| ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U' || ch == 'Y')
{
printf("%c is a vowel\n", ch);
}
else
{
printf("%c is not a vowel\n", ch);
}
}

return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS