answersLogoWhite

0


Best Answer

int secondmax (int a[], int n)

{

int i, max, second;

for (i=0; i

if (i==0 a[i]>max) second= max, max= a[i];

else if (i==1 a[i]>second) second= a[1];

}

return second;

}

int middle (int a[3])

{

return secondmax (a, 3);

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

Sort the list using Quicksort & pick the middle item

This answer is:
User Avatar
User Avatar

varun kani

Lvl 1
1y ago
Answer

User Avatar

Wiki User

7y ago

Algorithm for average of 3 numbers:

  1. Sum the 3 numbers.
  2. Divide the sum by 3.
This answer is:
User Avatar

User Avatar

Evan Karki

Lvl 2
2y ago

[object Object]

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the algorithm for average of three numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How can you use the Euclidean Algorithm to find the GCF of three numbers?

By dividing


How do you describe an algorithm with rational numbers?

Describe an algorithm for dividing rational numbers.


What is the GCF of 180 336 and 504?

You can use Euclid's algorithm to calculate the gcf of two of the numbers - then use Euclid's algorithm again with the result and the third number.Or you can factor all the numbers into prime factors, and check which prime factors occur in all three numbers.


What is the average of 5000 and 7000?

To calculate the average of two numbers, add them together, and divide the result by 2. (For the average of three numbers, you add up the three numbers, and divide by three, etc.) The average is (5000 + 7000)/2 = 6000


What are the three numbers if the average of three consecutive numbers is 126?

125, 126 and 127.


What are three prime numbers where the average is a prime number?

3, 5, and 7 are three prime numbers whose average is 5.


Could an average of three numbers be one of those three numbers?

Yes. For example, the average of 5, 7, and 9 is 7.


What is the average of 51 52 on 56?

The average of the numbers 51, 52, and 56 is 53. To get the average you would add all three numbers and then divide by three.


Write algorithm compute sum of square of N numbers?

1. Design an algorithm to compute sum of the squares of n numbers?


The average of the first three numbers was sixThe average of the next seven numbers was 19 What was the overall average of all 10 numbers?

12


What is an algorithm for multiplying rational numbers?

The algorithm is A/B * C/D = AB/CD.


What are three prime numbers where the average is also a prime number?

3, 5, and 7 are three prime numbers whose average is 5.