Skip to content

Instantly share code, notes, and snippets.

Created August 30, 2012 22:25
Show Gist options
  • Save anonymous/3543037 to your computer and use it in GitHub Desktop.
Save anonymous/3543037 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(int argc, char * argv[])
{
float acc = 0.0;
float inputN = 0.0;
int i = 0;
int N = 0;
printf("How many?: ");
scanf("%d", &N);
for (i = 0; i < N; i++)
{
printf("Number: ");
scanf("%d", &N);
acc += inputN;
}
acc /= (float)N;
printf("acc = %f\N", acc);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment