Development C

#include
#include
int main(void) {
char line[1024];
char *ptr = NULL;
int i = 0;
while(fgets(line, 1024, stdin) != NULL) {
i++;
if(i == 1)
ptr = strdup(line);
if(i == 2) {
printf("%s", line);
printf("%s", ptr);
i = 0, free(ptr), ptr = NULL;
}
}
return 0;
}