Question #1 The following program (in the next page) reads integer numbers from a file named numbers.txt. For each number, the program computes the reverse in order to check whether the number is a palindrome number or not. It then reports the results into a file named Report.txt (4 palindrome is any number whose reverse is also same. eg. 1221.23432, 7, 8 are palindromes, but 23489 is not). Suppose the file numbers.txt contains the following numbers: 2542 13831 303 55 3324 numbers.txt Study the program carefully and answer the below questions: Hint: you might run the program before starting answering the questions! a) Show the output of the program. Assume that the file numbers.txt contains the data shown above #include
#include int main(void) int number, reverse = 0, digit, temps FILE "infile, "outfile: int status //open the input file and check if an error occurred infile = fopen("numbers.txt'); //open the input file infile NULLY printf("Error: File\"numbers.txt not found!"); exit (1); //open the output file and check if error occurred outfile = fopen("Report.txt", "); iffoutfile NULLY printf("Error: File \"Report it can not be created a"); 1 status = fscanf(infile, "%d", &number): read first number from the file while status l-EOF //To read all the numbers in the file printf("%d is read from the file ", number): fprintf(outfile, "ad"number //compute the reverse of the number temp = number: reverse = 0; while(temp 1-0 digit temp%10: reverse reverse 10 digt; temp = temp/10, > printf("The reverse is: %d ", reverse fprintffoutfile, "d", reverse): // check whether the number is palindrome if(number reverse) printf("%d is a palindrome number nin", number: fprintf(outfile, "t Palindromein"); else! printf("%d is not a palindrome number lala", number fprintf(outfile, "t Non Palindrome //read another number from the file status = fscanffinfile, "%d", &number): //close the files fclose(infile): fclose(outfie) return 0