Sample Input :
1
Tamil
Sample Output :
Taamiil
#include<stdio.h>
1
Tamil
Sample Output :
Taamiil
#include<stdio.h>
int check_vowel(char);
int main()
{
char s[100];
int i, j = 0;
int count=0;
int n;
scanf("%s",s);
n=strlen(s);
printf("%d%s",n,s);
for(i = 0; i<n; i++)
{
if(check_vowel(s[i])==1)
{
for(j=n-1;j>=i;j--)
{
s[j+1]=s[j];}
i++;
}
}
n++;
}
printf("String after repeating vowels: %s\n", 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;
break;
default:
return 0;
}
}
No comments:
Post a Comment