#include<'stdio.h'>
main()
{
char name[20];
//input
printf("enter the name : ");
scanf("%s",&name);
//out
printf("**%s** \n",name);
//count
int count=1;
for(count=0;name[count]!='\0';count++);
printf("count %d \n",count);
flushall();
/*
char n;
printf("enter the letter : ");
scanf("%c",&n);
int ncount = 0, i =0;
for(i=0;i<=count;i++)
if(name[i]==n)
ncount++;
printf("ncount %d \n",ncount);*/
//scanng lettr
char n;
printf("enter the letter (scan) : ");
scanf("%c",&n);
flushall();
//replacing letter
char m;
printf("enter the letter (replace): ");
scanf("%c",&m);
int i =0;
for(i=0;i<=count;i++)
if(name[i]==n)
name[i]=m;
printf("%s",name);
}
No comments:
Post a Comment