Write a c program to delete the all consonants from given string
Answers
Answered by
0
#include<stdio.h> #include<string.h> /* * * cplusplusp1 * indian (AIUB) * */ int main(){ char str[20]; int i,j; printf("Enter any string: "); scanf("%s",str); printf("\nThe string is: %s",str); for( i = 0;i < strlen(str); i++){ if(str[i] != 'a' && str[i] != 'e' && str[i] != 'i' && str[i] != 'o' && str[i] != 'u'){ for(j = i; j < strlen(str); j++){ str[j] = str[j+1]; } i--; } } printf("\n\n Rest Of The string is: %s",str); return 0; }
Similar questions