SHARE
TWEET

Untitled

TaniaTanni Oct 23rd, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. int main ()
  3. {
  4.     int a,b,i,sum=0,count=0;
  5.     float avg;
  6.     scanf("%d,%d",&a,&b);
  7.     i=a;
  8.     while(i<=b)
  9.     {
  10.         sum=sum+i;
  11.         count++;
  12.         i++;
  13.         avg=((float)sum/count);
  14.     }
  15.     printf ("sum=%d/n",sum);
  16.     printf ("avg=%.2f/n",avg);
  17. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top