View Single Post
Old Apr 17th, 2005, 8:08 PM   #6
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,076
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
Nope spaces don't count.

Legacy, I said already:


The output of the program will be:
(1) 6 Even
(2) 0 Even
(3) 5 Odd
(4) 0 Even
(5) 4 Even
(6) 9 Odd
(7) 8 Even
(8) 9 Odd
(9) 4 Even
(10) 4 Even

Average: 4.9 Odd

Where:
The program outputs x amount of random integer values between 1 and 10. Lists if it is even/odd. Then at the end, prints the average in 1 decimal place float, and if it is even or odd (rounded up if >.4, rounded down if <.5).

You have to be able to change the length of outputs with a single variable change (to prevent making a manual loop into one line of code).
Sane is offline   Reply With Quote