SHARE
TWEET

Untitled

TaniaTanni Oct 23rd, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. int main ()
  3. {
  4.     int i,sum=0, count=0;
  5.     float avg;
  6.     for(i=1;i<=100;i++)
  7.     {
  8.         sum=sum+i;
  9.         count++;
  10.         avg=((float)sum/count);
  11.     }
  12.     printf ("sum=%d/n",sum);
  13.     printf ("avg=%.2f/n",avg);
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top