Write a C program to accept string from the user & replace all occurrences of character ‘a’ by ‘*’ symbol.


#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,flag=0;
char s[50];
clrscr();
printf("\n enter the string:-");
gets(s);

while(s[i]!=NULL)
{
if(s[i]=='a')
{
s[i]='*';
}

i++;
}
printf("\n the string is %s",s);
getch();
}
/* output

 enter the string:- india
 the string is  indi*     */