repl.it
@maniero/

IsVowel.c

C

No description

fork
loading
Files
  • main.c
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>
#include <string.h>

int main() {
    char input, vowels[] = "aeiou", upperVowels[] = "AEIOU", consonants[] = "bcdfghjklmnopqrstuvwxyz", upperConsonants[] = "BCDFGHJKLMNPQRSTVWXYZ";
    printf("Enter the symbol: ");
    scanf("%c", &input);
    if (strchr(vowels, input) != 0) printf("vowels!");
    else if (strchr(upperVowels, input) != 0) printf("Upper vowels!");
    else if (strchr(consonants, input) != 0) printf("Consonants!");
    else if (strchr(upperConsonants, input) != 0) printf("Upper Consonants!");
    else printf("You entered another character!");
}

//https://pt.stackoverflow.com/q/404274/101