Calculates the circumference of a disc
Delphi & Pascal (česká wiki)
Category: Homework in Pascal
Program: Kruh.pas
File exe: Kruh.exe
Program: Kruh.pas
File exe: Kruh.exe
Calculates the circumference of a disc.
Formula for circumference of a disc is 2·π·r.
Formula for area of a disc is π·r².
Description:
- r is radius
- π is Ludolf's number 3.14159
Program for calculate π is here Pi.pas
Formula for circumference of a disc is 2·π·r.
Formula for area of a disc is π·r².
Description:
- r is radius
- π is Ludolf's number 3.14159
Program for calculate π is here Pi.pas
{ KRUH.PAS Copyright (c) TrSek alias Zdeno Sekerak } { Vypocita obvod kruhu } { Vstup : polomer kruhu } { Vystup: obvod kruhu pre danny polomer } { } { Datum:10.04.2000 http://www.trsek.com } program kruh; uses crt; var r,obvod,obsah: real; begin Clrscr; Write('Zadaj polomer kruhu:'); ReadLn(r); obvod:=2*3.1415*r; obsah:=3.1415*r*r; WriteLn('Obvod kruhu je:',obvod:5:2,' a jeho obsah je ',obsah:5:2); Readln; end.