Log in

View Full Version : Average returned as 0.0?


Zenboraku
Sep 19, 2013, 08:57 AM
Hi, I'm currently trying to make a program that throws a dice 30 times and then returns the average throw.

It looks like this; Image #238502 - CtrlV.in Image Hosting (http://ctrlv.in/238502)
I don't know why my average is returned as 0.0.
Anyone know why?
Thank you for your time.

Pelusawoman
Sep 20, 2013, 01:37 PM
What are you doing with total?

double average;
double total; (What is the value? Zero?)
...
average = total/30;