#include <stdio.h>

int main() {
    int arr[9];
    int i,sum=0;
    float avg;
    printf("\nenter the elements of the array: ");
    for (i=0;i<5;i++){
        scanf("%d",&arr[i]);
    }
    for (i=0;i<5;i++){
        printf("\n%d",arr[i]);
        sum=sum+arr[i];
    }
    printf("\nthe sum of all elements of the array =%d",sum);
    avg=sum/5;
    printf("\navg=%f",avg);
    
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: