Advertisement
LegoDrifter

K,A 4

Dec 17th, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int i,suma=0,n;
  7. float avg;
  8. scanf("%d",&n);
  9. for(i=1;i<=n;i++)
  10. suma+=i;
  11. avg=suma/(float)n;
  12. printf("%d %.2f \n",suma,avg);
  13. return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement