Sunday, November 1, 2020

C program to display even numbers, sum and their average in between 1 to 10

 #include <stdio.h>

int main()

{

    int i,sum;

    for(i=2;i<=10;i+=2)

    {

        printf("%d\n",i);

        sum+=i;

    }

    printf("Sum=%d\n",sum);

    printf("Average=%d",sum/5);

    return 0;

}


No comments:

Post a Comment

POV: I finally understood why every elder brother is a hero ❤️

YouTube Video  Hi. So, uh very happy brother's day to all the lovely brothers out there who has been endlessly working on and uh taking ...