PART A
Write a function named twomax that takes a pointer to an array of integer numbers, array size, a pointer to integer which is the index of the first maximum, and another pointer to integer which is the index of the second maximum as parameters. The function should find and return the index (subscript or position) of the first maximum element and the index of the second maximum element in the array of integers. The function prototype is:
void twomax (int *arr, int size, int *p1, int *p2);
Example: If the array contains:
6 55 60 50 3 40
The index of the first maximum is 2, and of the second maximum is 1
PART B
Write a function named from_1_to_2 that takes as parameters pointer to one dimension array, pointer to two dimensional array, the size of the one-dimensional array, and the row size of the two-dimensional array where the number of rows is equal to the number of column. The function should store the content of the one-dimensional array in the two dimensional array as shown in the example below using dynamic two dimensional array. The
void from_1_to_2(int * array1d ,int ** array2d, int array1dsize, int array2dsize)
If array1d of size 9 and contains:
10 20 30 40 50 60 70 80 90
The array2d would be 3 X 3 and contain:
10 20 30
40 50 60
70 80 90
PART C
In the main function:
1. Declare an array of integers and in it some elements.
2. Call the function twomax.
3. Output the array.
4. Output the index of the first maximum element and the index of the second maximum store element in the array.
5. Declare two dimensional array of integers.
6. Call the function from_1_to_2.
7. Output the new two dimensional array (each raw in a line).
احد يشرح لنا الاسايمنت :tears: