1-10 ARASI HESAP MAKİNESİ PROGRAMI
uses crt;
var
x1,x2:longInt;
sonuc:real;
oper:char;
dogru:boolean;
begin
clrscr;
dogru:=true;
write('1.say:'); readln(x1);
write('2.say:'); readln(x2);
write('operat”r(+-/*):'); readln(oper);
case oper of
'+' : sonuc:=x1+x2;
'-' : sonuc:=x1-x2;
'/' : sonuc:=x1/x2;
'*' : sonuc:=x1*x2;
else dogru:=false;
end;
if not dogru then writeln('yanls operat”r')
else
writeln(x1,oper,x2,'=',sonuc:0:2);
readln;
end.
|