Determine average of school numbers
Delphi & Pascal (česká wiki)
Category: Homework in Pascal
Author: Juraj Pupák
Program: Average.pas
File exe: Average.exe
File ubuntu: Average
Author: Juraj Pupák
Program: Average.pas
File exe: Average.exe
File ubuntu: Average
Determine average of school numbers. Input finished when you put zero.
{ AVERAGE.PAS } { Vypocet priemeru znamok. } { } { Author: Juraj Pupak } { Date : 27.10.2006 http://www.trsek.com } program Average; uses crt; var sucet,pocet,i,znamka : integer; priemer : real; begin clrscr; Repeat write('Zadaj znamky (0-koniec): '); readln(znamka); sucet := sucet + znamka; pocet := pocet + 1; Until znamka = 0; priemer := sucet div (pocet - 1); writeln; writeln('Znamka je: ',priemer : 2 : 0); readln; end.