Answer to Question #274781 in C++ for Asif

Question #274781

5. Write a C Program to calculate the Average of an array elements where the elements are received as input

1
Expert's answer
2021-12-07T15:05:09-0500
#include <stdio.h>
#include <string.h>


int main()
{
    double average = 0, arr[10];
    for (int i = 0; i < 10; i++) {
        scanf("%d\n", &arr[i]);
        average += arr[i];
    }
    average = average / 10;
    printf("%d\n", average);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment