Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main (){
- int sum=0,i;
- double avg;
- int a=0;
- for(i=1;i<=100;i++){
- a=a+1;
- sum=sum+a;
- }
- printf("%d is the Sum\n",sum);
- avg=sum/100;
- printf("%lf is the Average\n",avg);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement