Programalama > PASCAL

Etiketler: hesap, makinesi

Ort. 5
Puan ver:
uses crt;
var
x,t,a,b:integer;
sec2,sec:char;
procedure menu;
begin
clrscr;
gotoxy(35,5);write('1- TOPLAM');
gotoxy(35,7);write('2- FARK');
gotoxy(35,9);write('3- ÇARPIM');
gotoxy(35,11);write('4- BÖLME');
gotoxy(35,13);write('5- ÇIKIŞ');
gotoxy(40,16);write('SEÇİMİNİZ[  ]');gotoxy(50,16);readln(sec);
end;
procedure toplam;
begin
clrscr;
t=0;
write('kaç sayı toplanacak:');readln(a);
for x:=1 to a do begin
write(x,'. sayıyı giriniz:');readln(b);
t:=t+b;
end;
write('toplam:',t);
end;
procedure fark;
begin
clrscr;
t=0;
write('bir sayı giriniz:');readln(a);
write('bir sayı giriniz:');readln(b);
t=a-b;
write('fark:';t);
end;
procedure carp;
begin
clrscr;
t=0;
write('kaç sayı çarpılacak:');readln(a);
for x:=1 to a do begin
write(x,'.sayıyı giriniz:');readln(b);
t:=t*b;
end;
write('sonuç:',t);
end;
procedure bol;
begin
clrscr;
write('bir sayı giriniz:');readln(a);
write('bir sayı giriniz:');readln(b);
t:=a/b;
write('sonuç:',t);
end;
begin
clrscr;
repeat
menu;
if sec='1' then toplam;
if sec='2' then fark;
if sec='3' then carp;
if sec='4' then bol;
if sec='5' then halt;
readln;
gotoxy(5,22);write('ana menüye dönmek için "A" ya basınız...');
readln(sec2);
until sec2<>'A';
end.

{doğukan güney}


Yorumlar                 Yorum Yaz
Bu hazır kod'a ilk yorumu siz yapın!
KATEGORİLER
ASP - 240
ASP.NET - 24
C# - 75
C++ - 174
CGI - 8
DELPHI - 247
FLASH - 49
HTML - 536
PASCAL - 246
PERL - 11
PHP - 160
WML - 9
XML - 2
Copyright © 2002 - 2024 Hazır Kod - Tüm Hakları Saklıdır.
Siteden yararlanırken gizlilik ilkelerini okumanızı tavsiye ederiz.
hazirkod.com bir İSOBİL projesidir.