I just want to calculate the average of an array
but i cant seem to get it to work right.
Code:#include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int x,c; int Array[5]={ 99,105,67,23,79 }; for ( x=0; x<5; x++ ) Array[x]= Array[x]+ Array[x]/5; for(c=0;c<5;c++) printf("average is %i\n",Array[c]); getchar(); return 0; }



LinkBack URL
About LinkBacks


