Klavyeden -1 girilene kadar girilen notların ortalaması

#include <stdio.h>

int main(void)
{
int toplam = 0, not, sayac = 0;
float ort;

printf("Not gir:");
scanf("%d", &not);

while (not != -1)
{
sayac++;
toplam += not;
printf("Not gir:");
scanf("%d", &not);

}


ort = (float)toplam / sayac;
printf("Ortalama = %.2f", ort);

getch();
}

Yorumlar