Forums: » Register « |  Free Tools |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |

New Free Tools on Dev Shed!

#1
May 29th, 2013, 04:54 AM
 vaaljan
Registered User

Join Date: May 2013
Posts: 2
Time spent in forums: 34 m 8 sec
Reputation Power: 0
URGENT help needed Array and average

Hi there, im studying IT and my current module is introduction to programming. I have only basic knowledge of programming but this handbook is truly rubbish!

The question is :
An array called numbers contains 10 valid integer numbers. Determine and display how many of these values are greater than the average value of all the values of the elements. Hint: Calculate the average before counting the number of values higher than the average

Could anyone help me out?

#2
May 29th, 2013, 05:04 AM
 kathyrollo
Contributing User

Join Date: Dec 2012
Location: Metro Manila, Philippines
Posts: 64
Time spent in forums: 1 Day 2 h 48 m 13 sec
Reputation Power: 4
You are supposed to post the code you have done so far and people here would point you to the right direction.

#3
May 29th, 2013, 05:11 AM
 vaaljan
Registered User

Join Date: May 2013
Posts: 2
Time spent in forums: 34 m 8 sec
Reputation Power: 0
My apologies

Quote:
 Originally Posted by kathyrollo You are supposed to post the code you have done so far and people here would point you to the right direction.

Sorry!

Forgot that part.

Algorithm
~input
for num=o to 9
display "provide the first number", num+1
enter num

next
~calculations
num / 10 = avg

If num> avg
Then
?????

How to count evey number thats more than the average number in the array.

Thanks

#4
May 29th, 2013, 07:13 AM
 Narcon-sama
Registered User

Join Date: May 2013
Posts: 4
Time spent in forums: 2 h 28 m 50 sec
Reputation Power: 0
just declare an integer variable
and increment it in scope of "if then" statement

 Viewing: Dev Shed Forums > Programming Languages > C Programming > URGENT help needed Array and average