Created
December 16, 2022 13:37
-
-
Save NguyenTatNhac/5a04f81f2ac25bdb57768fc516787121 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int isConsonant(char ch) | |
{ | |
if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) | |
{ | |
if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' || ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U') | |
{ | |
return 0; | |
} | |
else | |
{ | |
return 1; | |
} | |
} | |
else | |
{ | |
return 0; | |
} | |
} | |
void consonant(const char *s) | |
{ | |
for (char c = *s; c; c = *++s) | |
{ | |
if (isConsonant(c)) | |
{ | |
printf("%c", c); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment