PROGRAM W FREEPASCALU : POLE POWIERZCHNI CAŁKOWITEJ I OBJĘTOŚCI WALCA, z warunkami tzn. r>0 itp.
program walec;uses crt;var a,r,pp,pb,p,o: real;
BEGIN Write('Podaj promien podstawy r : '); repeat readln(r); until r>0 Write('Podaj wysokosc h : '); repeat readln(h); until h>0 pb:=2*3.14*r*h; sqr(r); pp:=3.14*r; p:(pp+pb)*2; o:=3.14*r*h; Writeln('Objetosc walca wynosi ',o:0:2,' [j3]'); Writeln('Pole powieszchni walca wynosi ',p:0:2,' [j2]'); readln;
END;
" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
program walec;
uses crt;
var a,r,pp,pb,p,o: real;
BEGIN
Write('Podaj promien podstawy r : ');
repeat
readln(r);
until r>0
Write('Podaj wysokosc h : ');
repeat
readln(h);
until h>0
pb:=2*3.14*r*h;
sqr(r);
pp:=3.14*r;
p:(pp+pb)*2;
o:=3.14*r*h;
Writeln('Objetosc walca wynosi ',o:0:2,' [j3]');
Writeln('Pole powieszchni walca wynosi ',p:0:2,' [j2]');
readln;
END;