123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home
Source Codes
Engineering Colleges

Training  Reports
Seminar Reports
Placement Papers

Forums

   Computer Science / IT
   Electronics
   Electrical
   Mechanical
   Chemical
   Civil

   CAT / MBA

   GMAT / Foreign MBA
Latest Jobs

Engineering Jobs / Technical Jobs
Management Jobs

Sitemap
Terms of use

Displaying  Source Code(s)  
 

 
Program. to find & replace any desired character from the input text.

--------------------------------------------------------------------------------



#include <stdio.h>
# include <conio.h>
char c1,c2,a[80];
void main()
{
clrscr();
find_rep();
getch();

}

void find_rep(void)
/* Function to find & replace any text */
{
char c1,c2;
char a[80];
int i,j,k;
printf("
Enter a line of text below:-");
printf("
Line will be terminated by pressing ENTER.");
printf("
TEXT:- ");
gets(a);
printf("
Enter the replaceable & replacing letter respectively:- ");
scanf("%c%c%c",&c1,' ',&c2);
for (j=0;j<80;j++)
{
if (a[j]==c1)
a[j]=c2;
}
puts(a);
printf("
Here all %c are replaced by %c.",c1,c2);
return;
}
 

 

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved © copyright 123ENG