C program replace vowel in string


This C program accepts a string of min 15 characters. Replace all the vowels in the string with the character ‘*’. Do not use any standard library function. This is a part of Mumbai University MCA Colleges C Program MCA Sem 1


#include<stdio.h>
#include<conio.h>
void main()
{
char st1[50];
int i;
clrscr();
printf("Enter any string");
scanf("%s",st1);
while(s1[i]!=’\0’)
{
len++l
i++;
}
if(len<=15)
printf(“Plz, Enter more than 15 characters”);
else
{
for(i=0;i<15;i++)
{
if(st1[i]=='a' || st1[i]=='e' || st1[i]=='i' || st1[i]=='o' || st1[i]=='u' || st1[i]==’A’ || st1[i]==’E’ || st1[i]==’I’ || st1[i]==’O’ || st1[i]==’U’)
{
st1[i]='*';
}
}
}
printf("\n After replacing vowels by * string will be %s",st1);
getch();

}


Hope this Program is useful to you in some sense or other. Keep on following this blog for more Mumbai University MCA College Programs. Happy Programming and Studying.

No comments:

Post a comment