Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- int main()
- {
- int n, i;
- double average, summation = 0;
- scanf("%d", &n);
- for(i = 1; i <= n; i++)
- {
- summation += i;//summation
- average = summation / n;// average
- }
- printf("summation = %.2lf\n", summation);
- printf("Average = %.2lf\n", average);
- for(i = 1; i <= n; i++)
- {
- if(i % 5 == 0 && i % 8 == 0)
- {
- printf("%d “Poopaye\n", i);// divisible by 5
- }else{
- if(i %5 == 0){
- printf("%d Bakayarou\n", i);
- }
- else if(i % 8 == 0){
- printf("%d Bananonina\n", i);
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement