Calcular nota media de 3 notas

an anonymous user · September 16, 2020 · C++
#include <iostream>
using namespace std; 
int main(void) {
    
    float nota1;
    float nota2;
    float nota3;
    float media;
    
    cout << "Primera nota?" << endl;
    cin >> nota1;
    cout << "Segunda nota?" << endl;
    cin >> nota2;
    cout << "Tercera nota?" << endl;
    cin >> nota3;
    media = ( nota1 + nota2 + nota3 ) / 3;
    cout << "Nota 1=" << nota1 << endl;
    cout << "Nota 2=" << nota2 << endl;
    cout << "Nota 3=" << nota3 << endl;
    cout << "Nota media=" << media <<endl;
    return 0;
}

Comments

Please sign up or log in to contribute to the discussion.