Test Array
Test Array
variables.
Write a menu-based program with the following menu:
1. Input N and array of integer numbers
2. Find the largest even negative number
3. Calculate total of the ODD numbers
4. Calculate greatest common divisor of all array members
5. Display all elements
6. Exit
When user chooses 4 from main menu, calculate greatest common divisor of all
array members and return this value to the main function for printing out.
Example1:
Arr[0]=4 Arr[1]=6 Arr[2]=16 Arr[3]=14 Arr[4]=12
greatest common divisor of all array is: 2
Example2:
Arr[0]=4 Arr[1]= -6 Arr[2]=16 Arr[3]= -14 Arr[4]=12
greatest common divisor of all array is: 2
Q5. When user chooses 5 from menu: Sorted all elements by ascending and then display them
Q6. Exit
When user chooses 6 from main menu, the program will be exit.