#include <stdio.h>

int main() {
    int n=0;
    float note=0;
    float m=0;
    while (note!=-1) {
        scanf("%f\n",&note);
        n++;
        m+=note;
    }
    if (m==-1)
        printf("vous devez rentrer des notes !\n");
    else {
        float M=m/n;
        printf("la moyenne est de %f\n",M);
    }        
}

Embed on website

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