NEED HELP IN WRITING A C PROGRAM!

Q-3 Write a program to take 10 values in an array and find average of them.
EXAMPLE OUTPUT :
ENTER 10 VALUES IN ARRAY :
1
2
3
4
5
6
7
8
9
10
AVERAGE OF ALL 10 NUMBER IS: 5.5

#include <stdio.h>
int main()
{
    float sum = 0;
    printf("ENTER 10 VALUES IN ARRAY :\n");
    for(int i=0;i<10;i++)
    {
        int temp;
        scanf("%d",&temp);
        sum = sum + temp;
    }
    printf("AVERAGE OF ALL 10 NUMBERS IS: %f",sum/10);
    return 0;
}

I feel you shouldn’t have asked it in forum. It’s Awful.

4 Likes

#include<stdio.h>
int main()
{
int a[10],sum=0;
for(int i=0;i<10;i++)
{
// Taking Array inputs:
scanf("%d",&a[i]);

// Performing Addition operation:
sum+=a[i];
}
printf("%d",sum/10);
return 0;
}

2 Likes

Thank you for helping me,
and im a newbie in programming and hv nobody to discuss questions thts why i posted it here !!

thank you

Instead of asking here first google and still u r unable to understand then ask.

No issues…you will eventually get better… I am also a newbie.