Write the pseudo code (algorithm) for the following program definition: a text file contains a square matrix of integer numbers. The file contains an integer number indicating the identical number of rows and columns followed by the data itself (that number cannot be larger than 100). For example a file contains a 3x3 matrix would contain 3 followed by 9 other integer numbers. The program will call one function to determine if all the numbers on the main diagonal are the same.
The function is called checkdiag(int checkdiag (int matrix[][100], int size)) that will return 1 if all the numbers on the main diagonal are the same and 0 otherwise.
Your program will read the array from the file, check the diagonal and print a report containing the size and the status of the diagonal. A typical report would look like: The matrix is 3x3 and all the numbers on the main diagonal are the same.
Part 2:
Write another function called checkdiag2(int checkdiag2(int matrix[][100], int size)) that will return 1 if all the numbers on the anti diagonal are the same and 0 otherwise.
Rewrite your main program to use 2D dynamic allocation instead for your arra. Your array will have rows and columns depending of the first integer read from the file.
Call your function from the main program. A typical report would look like: The matrix is 8x8 and all the numbers on the anti diagonal are the same.