Merging two files in one in C/C++

We are opening first file firstFile.txt secondly file secondFile.txt and then reading line by line both of these files and writing a line of first file to third file and then contents of first line of second file to thirdFile. Like :
 
first line of first file
first line of second file
second line of first file
second line of second file
..
..
..
nth line of first file
nth line of second file

 

#include <stdio.h>
int main()
{
	FILE *firstFile, *secondFile, *thirdFile;
	char ch[2];
	firstFile = fopen("firstFile.txt", "r");
	secondFile = fopen("secondFile.txt", "r");
	thirdFile = fopen("thirdFile.txt", "w");

	if ((firstFile == NULL) || (secondFile == NULL) || (thirdFile == NULL))
	{
		puts("something went wrong");
		getchar();
		exit(0);
	}

	while (1)
	{
		ch[0] = fgetc(firstFile);
		ch[1] = fgetc(secondFile);
		// check for end of file character
		if ((ch[0] == EOF) || (ch[1] == EOF))
			break;
		else
		{
			do
			{
				// write first character of first file to thirdFile
				fputc(ch[0], thirdFile);
				ch[0] = fgetc(firstFile); // get character from next location
			} while (ch[0] != '\n'); // loop until newline character

			fputc('\n', thirdFile); // write a newline character to thirdFile

			do
			{
				// write first character of second file to thirdFile
				fputc(ch[1], thirdFile);
				ch[1] = fgetc(secondFile); // get character from next location
			} while (ch[1] != '\n'); // loop until newline character
			fputc('\n', thirdFile); // write a newline character to thirdFile
		}
	}

	// close all files
	fclose(firstFile);
	fclose(secondFile);
	fclose(thirdFile);

	getchar();
	return 0;
}