I have written this code from an algorithm given by my friend. But when I try to implement it it's not working. Can anyone tell me error here?
#include<stdio.h>
void scat(char [], char []);
int i,j;
void main()
{
char s1[10],s2[10];
printf("Enter first string: ");
scanf("%s",&s1);
printf("Enter second string: ");
scanf("%s",&s2);
scat(s1,s2);
}
void scat(char s1[], char s2[])
{
char str1[10],str2[10],str3[20];
for(i=0;str1[i]!=NULL;i++)
str3[i]=str1[i];
for(j=0;str2[j]!=NULL;j++,i++)
str1[i]=str3[j];
printf("\nConcanated string is %s",str3);
}