#include <stdio.h>
#include <conio.h>
int main()
{
char s1[81], s2[81], temp;
int i, j;
clrscr();
printf("enter string <s1> : ") ;
gets(s1) ;
printf("enter string <s2> : ") ;
gets(s2) ;
for(i = 0; s1[i] && s2[i]; i++) {
temp = s1[i] ;
s1[i] = s2[i] ;
s2[i] = temp ;
} //end of for
if(s1[i]) { //s1 has many char
j = i ;
while(s1[i])
s2[i] = s1[i++] ;
s2[i]='\0' ;
s1[j]='\0' ;
}//end of if
else if (s2[i]) { //s2 has many char
j = i ;
while(s2[i])
s1[i] = s2[i++] ;
s2[j]='\0' ;
s1[i]='\0' ;
} //end of else if
printf("new content of s1 is:") ;
puts(s1) ;
printf("new content of s2 is:") ;
puts(s2) ;
getch();
return 0;
}