לא הבנתי איך להשתמש ב repeat... (קראתי ממדריכים....), אז השארתי את ה GOTO...
וזה מה שאמרת לא?program calc; uses crt; var num1,num2 :integer; action :char; label 1; begin textcolor(yellow); 1: writeln('write the first number'); readln(num1); writeln('write the second number'); readln(num2); writeln('pick the action you want to do:'); writeln('1-Addition 2-Subtraction 3-Multiplication 4-Division'); action:=readkey; if action=1 then writeln(num1,'+',num2,'=',num1+num2); if action=2 then writeln(num1,'-',num2,'=',num1-num2); if action=3 then writeln(num1,'*',num2,'=',num1*num2); if action=4 then writeln(num1,'/',num2,'=',num1/num2:1:2); if action>4 then goto 1; readln; end. |