#include <stdio.h>
int main ()
{
char a[100],c;
int i,j;
printf("Enter string: ");
gets(a);
fflush (stdin);
printf("Enter a character which one you want to change: ");
scanf("%c",&c);
for(i=0;i<a[i];i++)
{
if(a[i]==c)
{
if(a[i]>='A'&&a[i]<='Z')
a[i]=a[i]-'A'+'a';
else if (a[i]>='a'&&a[i]<='z')
a[i]=a[i]-'a'+'A';
}
printf("%c",a[i]);
}
return 0;
}
No comments:
Post a Comment