These question was asked in AMCAT Automata Examination.
Write a program to remove all vowels from the given string.
Input : How are you
Output: Hw r y
Write a program to remove all vowels from the given string.
#include <stdio.h> int main(void) { char a[20]; int i=0; printf("Enter a lowercase String: "); gets(a); while(a[i]!='\0') { if(a[i]>95 && a[i]<122) { if(a[i]=='a'||a[i]=='e' ||a[i]=='i'||a[i]=='o' || a[i]=='u'){ // do nothing } else{ printf("%c",a[i]); } } else printf("%c",a[i]); // to print spaces between words i++; } return 0; }
Input : How are you
Output: Hw r y
Check Out More Questions from AMCAT Automata Test : Click here
0 Comments