answersLogoWhite

0


Best Answer

You really don't want to do this in a shell script - scripting languages in Unix typically do not handle or work with floating values, only integers. A better way would be to write a program to do this that works under Unix, such as a 'C" program.

See the related link for an example

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Unix script to calculate average of n numbers given by user?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you calculate a team's average performance in a given season?

add up all the numbers, then divide by the number of numbers you added.


What is the average of 3 6 9 2?

5. 3+6+9+2 = 20 20 / 4 = 5. To calculate the average of a series of numbers you have to add them together and divide them by the amount of numbers given.


Shell script to find amstrong numbers within a given range?

Check below link


How do you find the missing number in a set of numbers where the average is given?

The average of a set of numbers is defined as the sum of those numbers divided by the number of numbers. If the average is given, multiply that by number of items in the set including the missing number. Subtract the sum of given numbers from this quotient and the missing number is revealed.


What is the average of 1124 723 859?

The average of the given numbers is 902.


Average of numbers?

To find the average of a given set of numbers, total the numbers and divide that total by the number of members of the set.


What fraction or mixed number is in between -34 and -13?

-21


What number is bigger than 900 but smaller than 1000?

There are infinitely many numbers that are between any two given numbers. If you want the number that's exactly in the middle, calculate the average - that is, add the two numbers together, then divide the result by 2.


How do you make an average using given numbers?

add them all together and then divide the answer by the number of numbers.


What is the average of 8 9 10 11 12?

The mean average of the given numbers is 10


How do you calculate mean if the numbers are given as 345.06 345.09 347.09?

Add them up, divide by three.


What does calculate mean in math?

To calculate the mean, you add all the numbers you are given together, and divide by the number of numbers that you have been given. For example, if you're asked to calculate the mean of 3, 4, 5, 6, 7, 9, 12, 18: Add them together (64) There are 8 numbers, so divide by 8 (8) So the mean of this series is 8.