Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

Write a program that can determine the minimum value in a 1D array as well as the

array subscript for this array element. With the values:

9, 0, -3, 12, -8, 5, 2

and

10, -82, 93, 3, -56, 100, 4, 9

Addition requirments:

Write a function that receives a SINGLE array and the number of elements in the array and prints the array, so the return type will be

Write a function that receives a SINGLE array, the number of elements in the array, the address to a variable that can store the minimum value in the array, and the address to a variable that can store the array index of the minimum value in the array; the return type will be

void. The function will determine which array element has the smallest value and it’s position (remember they start at 0); it will use pointers to assign these values to the variables whose addresses were passed to the function.

sample output

The first array is:

9, 0, -3, 12, -8, 5, 2

The smallest element of the array is -8.

and it is at position 4.

The second array is:

10, -82, 93, 3, -56, 100, 4, 9

The smallest element of the array is -82.

and it is at position 1.

void.

Posted

This is a homework assignment.  If we did it for you, don't you think your teacher would notice that you didn't understand how to do it, and were therefore all the more incapable of doing the next piece of work assigned to you ?

do people really run clases in C nowadays ? For beginners ? I find that hard to believe.

 
Share this answer
 

I can see how someone might post something like this in a moment of desperation.  What I'd like you to understand is that it's for your own good that we won't answer this.  If you try to do this yourself and get stuck on a specific point and post asking for help, I'll be the first to answer, because I'll be helping you to understand the problem.  If I just posted the answer, I'd be robbing you of the chance to learn from your course.

 
Share this answer
 
i understand ill take off the post thank you i was just desperate thank you anyways.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900