View Single Post
Old Jan 30, 2007 | 09:05 PM
  #10  
Red X's Avatar
Red X
x pǝɹ
 
Joined: Feb 2003
Posts: 6,246
Likes: 1
From: Upstate
Default

do cout's after you set variables to ensure that they are getting stored properly. Double check that your loop control variable is what you want it to be and not just a random int.

Also, fix your declarations - at best its poor programming style to declare variables and only initialize some of them in the same line.

i.e.
int num, min, max, n;
double mean, sum = 0, count;

---
double mean, sum, count;
sum = 0;

Also, whats the purpose of this?
for (count = 0; count < 1; count++)
{
min = 0;
max = 0;
}

Its only going to run once.. why not just set the variables?
Reply