Go through the string, displaying only those characters that are not lowercase vowels. - C String

C examples for String:char array

Description

Go through the string, displaying only those characters that are not lowercase vowels.

Demo Code

#include <stdio.h>

int main( void ){
    char buffer[81];

    puts("Enter a line of text:");
    gets_s(buffer);//from   w  w w . j ava 2 s  . c om

    for (int ctr = 0; buffer[ctr] !='\0'; ctr++){
        if (buffer[ctr] == 'a' || buffer[ctr] == 'e'
           || buffer[ctr] == 'i' || buffer[ctr] == 'o'
           || buffer[ctr] == 'u')
              continue;
        /* If not a vowel, display it. */
        putchar(buffer[ctr]);
    }
    return 0;
}

Result


Related Tutorials