Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write and test a C program, save it as PRG2Ta1.C . Your program must have a comment line that contains your full name and your

Write and test a C program, save it as PRG2Ta1.C. Your program must have a comment line that contains your full name and your student number.

In the main function, create a local array variable to store exactly 9 numbers of double type. The main function asks the user to enter random (non-sorted) numbers to fill the array. Now, the main function must pass the array to a function called big4fun. This function has to do the following:

1. Compare the last element of the array with all other elements of the array.

2. Count how many values of all other elements of the array that are greater than the last element's value. If it cannot find any, return -1 to indicate that no such values are found. Otherwise, return the number of such values of other elements of the array that are great than the last element's value.

After having received the information from the function, the main function has to print a short message to tell the user the result.

Before ending the program, print "Press any key to continue ...", wait for the user to hit any key and exit.

If the program works, copy one test screen output and place it at the end of the C file as multiline comments within /* */.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions