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();
No comments:
Post a Comment