Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  trangle
Language: PASCAL
Code:
program triangle;
var
a, b, c, d: real;

begin
writeln; write ('Enter the value of first side>'); readln(a);
if a <= 0 then begin
writeln; writeln (' Impossible!');
halt
end;

writeln; write ('Enter the value of second side>'); readln(b);
if b <= 0 then begin
writeln; writeln (' Impossible!');
halt
end;

c:= sqr(a) + sqr(b);
d:= sqrt(c);

writeln; writeln ('Hypotenuse is ', d:7:2, ' cm long');
end.     
          
Comments: