Monday, July 31, 2017

Display string after deleting vowels in it in C

#include<stdio.h>
void main()
{
    char str[50],i;
    printf("Enter a string : ");
    gets(str);

    printf("\nAfter deleting vowels :\t");

    for(i=0;str[i]!='\0';i++)
    {
        if(str[i]=='a'||str[i]=='A'||str[i]=='e'||str[i]=='E'||str[i]=='i'||str[i]=='I'||str[i]=='o'||str[i]=='O'||str[i]=='u'||str[i]=='U')
        {
            continue;
        }
        else
        {
            printf("%c",str[i]);
        }
    }
    getch();
}

0 comments:

Post a Comment