Professional Documents
Culture Documents
h>
#include<conio.h>
#include<stdio.h>
void main()
{ char s1[20], s2[20], s3[50];
int x, l1, l2, l3;
clrscr();
printf("\n\nEnter two strings \n");
scanf("%s %s", s1, s2);
strcat(s1, s2);
/* comparing s1 and s2 */
printf("\n STRING COMPARE \n");
printf("\n -------------- \n");
x=strcmp(s1,s2);
if(x != 0)
printf("\n\nStrings are equal\n \n");
else
getch();
#include<stdio.h>
void main()
{
char source[10],target[10],ch;
FILE *f1,*f2;
puts("enter the source file name:");
gets(source);
puts("enter the target file name:");
gets(target);
f1=fopen(source,"r");
f2=fopen(target,"w");
if(f1==0&f2==0)
{
printf("f open error");
exit(0);
}
while((ch=getc(f1))>0)
putc(ch,f2);
fclose(f1);
fclose(f2);
}