Problem Description
Consider the birds are flying in the sky. It sees biscuits in the form letters. Since biscuits are in the form of vowels will more tastier than the other biscuits. So wherever the birds sees the vowels letter biscuits. It will eat. PRINT THE REMAINING BISCUITS.Test Case 1
Input (stdin)sowmiya
Expected Outputswmy
Test Case 2
Input (stdin)abcd
Expected Outputbcd
Program
#include <stdio.h> #include<string.h> int check_vowel(char); int main() { char s[100],t[100]; int i,j=0; scanf("%s",s); for(i=0;s[i]!='\0';i++) { if(check_vowel(s[i])==0) { t[j]=s[i]; j++; } } t[j]='\0'; strcpy(s,t); printf("%s",s); return 0; } int check_vowel(char c) { switch(c) { case 'a': case 'A': case 'e': case 'E': case 'i': case 'I': case 'o': case 'O': case 'u': case 'U': return 1; default: return 0; } }
No comments:
Post a Comment
Note: only a member of this blog may post a comment.