Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- void RemoveChars(char *s, char c)
- {
- int writer = 0, reader = 0;
- while (s[reader])
- {
- if (s[reader]!=c)
- {
- s[writer] = s[reader];
- writer++;
- }
- reader++;
- }
- s[writer]=0;
- }
- main()
- {
- int n=6;
- char ch1[n], ch2[n];
- int i, ch2_indx=0;
- for(i=0; i<n; i++)
- {
- scanf("%c", &ch1[i]);
- }
- for(i=0; i<n; i++)
- {
- if(ch1[i]=='a' || ch1[i]=='e' ||ch1[i]=='i'||ch1[i]=='o'||ch1[i]=='u'||
- ch1[i]=='A' || ch1[i]=='E' ||ch1[i]=='I'||ch1[i]=='O'||ch1[i]=='U')
- {
- ch2[ch2_indx++]=ch1[i];
- RemoveChars(ch1, ch1[i]);
- }
- ch2[ch2_indx]='\0';
- }
- strcat(ch1,ch2);
- for(i=0; i<strlen(ch1); i++)
- printf("%c", ch1[i]);
- }
Advertisement
Add Comment
Please, Sign In to add comment