Please can you help me with writing the following C program :
Write a program that accepts 10 integer store them in an array and determine the following:
1. sum
11. the average
111. highest
1v. lowest

Recommended Answers

All 3 Replies

Lets see what you have so far

Get started.

int main()
{
    //Create array
    //use a for loop to ask user for input
    // for i from 0 to array size   cin >> myArray[i];
   //create a sum,average, high and low variable;
   //Find sum first, initialize it to 0 first;
   //use a for loop from i = 0 to array size and have sum += myArray[i]
   //Next  find average. Average is Sum divided by array size
  //Go on from there and see what happens.
  return 0;
}

Please can you help me with writing the following C program :
Write a program that accepts 10 integer store them in an array and determine the following:
1. sum
11. the average
111. highest
1v. lowest

you have to make a variable name(s) for the array with 10 bytes in the memory, then use scanf if you want for asking the user for the input, then, all you have to do for the sum, average, highest, and lowest, is pretty much use your own math equation, within whatever that user had for the input, like for the sum it would be something like

myString[10] = 0

or
myString[1] = 0
myString[2] =0
.
.
.ect
al the way to ten


and then ask the user for 10 integers(numbers)

then make the equation for whatever they put in

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.