When I run the program, the second printf() prints string2 with whatever was scanned into string1 attached to the end.
printf()
string2
string1
e.g.
A string is a null terminated char array in C.
Change
char string2[4]={'1','2','a','b'};
to
char string2[5]={'1','2','a','b', '\0'};
(which is the same as char string2[] = "12ab";)
char string2[] = "12ab";