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

Everyone Is Fighting a Battle You Can't See ❤️ | A Simple Reminder to Be Kind

 Hi, namaste Krishna. So today we will be talking about that everyone is going through something in their life. Be it you, be it your friend...