#include <iostream>
using namespace std;
#define n 5

int main() {
    float x[n];
    float prom;
    cout<<"Programa que calcula promedio con arreglos"<<endl;
    prom=0;
    for(int i=0;i<n; i++){
        cout<<"da el valor de la calificacion#"<<i+1<<":"<<endl;
        cin>> x[i];
    }
    for(int i=0; i<n; i++)
        prom+= x[i];
    prom/=n;
    cout<<"el promedio es:"<<prom<<endl;
    return 0;
}

Embed on website

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