Created
April 3, 2014 15:32
-
-
Save matutter/9956647 to your computer and use it in GitHub Desktop.
nested for loops and running average
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for ( y = 0; y < rows ; y++) | |
{ | |
for ( x = 0; x < cols ; x++) | |
{ | |
number[y][x] = (rand() % 10001 + 5); | |
if(hi < number[y][x]) hi= number[y][x]; | |
count++; | |
avg-=avg/(float)count; | |
avg+=number[y][x]/(float)count; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment