LOVEPOPA's UNIVERSE of FREE Atari source listings !! AVERAGE.C |
/* (C) by PKF Source file AVERAGE.C Output file AVERAGE.TOS */ #include "stdio.h" main() { int w, s, c, f; w=0; s=0; c=0; f=0; while( w>=0 ) { c++; printf( "\n Please input the %d th number: ",c ); scanf( "%d",&w ); if( w>=0 ) { s=s+w; f=s/c; printf( "\n Current average is: %d",f ); } } } |
- MAIL TO ME - |