Question
Q2) - Prompt the user to enter a positive number of int elements, less than or equal to 50, or 0 to exit. If a
Q2) - Prompt the user to enter a positive number of int elements, less than or equal to 50, or 0 to exit. If a negative number or a number more than 50 is entered, prompt it is wrong and prompt for a positive number of elements less than or equal to 50; or 0 to exit.
If a valid (0< number <= 50) number of elements is entered, prompt the user to enter those many (as the number of elements already entered) integer elements (ignore cases to check that each value is integer - assume user enters integers). Accept the elements in an array.
Run the next steps with an array of size 10 - all indices are 0-based.
- - Print all the elements of the array
- - Print the starting address of the array and starting address of 0th element of array array_name[0]. Are they same ? ___________
- - Increment the 1st element - array_name[1].
- - Print the address of 2nd element - array_name[2]
- - Interchange the 3nd element - array_name[3] with the 4th element - array_name[4]. Use a separate function to do it.
- - Subtract the 6th element - array_name[6] from the 5th element - array_name[5] and store it in the 7th element - array_name[7] (overwrite the 7th - so earlier contents of 7th element will be lost). Use a separate function to do it. Choose what should be the arguments of the function to keep it generic.
- - Print the new array
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started