You will write a C program (location: task-2/solution-2.c) that will take two command line arguments. The first command line argument will be the name of the input file and the second command line argument will be the name of the output file.
Input: The input file will contain a sequence of hexadecimal numbers: one in each line followed by a terminating newline character (i.e., '\n). Each hexadecimal number will have digits from the following set: D = {0, 1, 2, . . . , 9, a, b, c, d, e, f}. Each input line will have the digits of an hexadecimal number printed in ASCII format. For instance, digit 0 will be character 0, digit 1 will be 1, and similarly, digit a will be character a and so on. Note that the input hexadecimal number can have leading zeros.
Assumptions: You can safely assume that each input line will have a maximum of 1024 characters including the newline character at the end of the line.
Output: For each hexadecimal number in the input file, you should print a line in the output file. The line should contain the corresponding binary representation of the hexadecimal number followed by a newline character (i.e., '\n). The binary number should be printed using ASCII characters: 0s and 1s. You should not remove the leading zeros from the binary representation of the hexadecimal number while printing to the output file.
Error checking: Your program should do appropriate error checking. In case of an error, your program must print the following error message: "An error has occurred\n" and then exit with the error code 1, e.g., using exit(1).