- Joined
- Jan 24, 2022
- Messages
- 7
- Reaction score
- 0
hi,
i am trying to write a code where it reads characters from its input and writes the same characters to its output, except it does not write lower case vowels ('a', 'e', 'i', 'o', 'u').
I have to use getchar() to read input.
Can anyone tell me what i am missing from this code?
#include <stdio.h>
int main(void) {
int character = getchar();
while (character != EOF) {
if (character != 'a' || 'e' || 'i' || 'o' || 'u') {
putchar(character);
}
character = getchar();
}
return 0;
}
i am trying to write a code where it reads characters from its input and writes the same characters to its output, except it does not write lower case vowels ('a', 'e', 'i', 'o', 'u').
I have to use getchar() to read input.
Can anyone tell me what i am missing from this code?
#include <stdio.h>
int main(void) {
int character = getchar();
while (character != EOF) {
if (character != 'a' || 'e' || 'i' || 'o' || 'u') {
putchar(character);
}
character = getchar();
}
return 0;
}