Natural numbers a, b, c are given. Check if there is a triangle of the magnitude of the angles, which in degrees
Natural numbers a, b, c are given. Check if there is a triangle of the magnitude of the angles, which in degrees, with a positive result, will set the form of the triangle: acute-angled, obtuse-angled, rectangular?
program zz1;
var a, b, c: integer; // set variables of non-integer type
begin
write (‘enter the first corner’); // enter the first number from the keyboard
read (a);
write (‘enter second corner’); // enter the second number from the keyboard
read (b);
write (‘enter the third corner’); // enter the second number from the keyboard
read (c);
if a + b + c = 180 then begin
if (a = 90) or (b = 90) or (c = 90) then write (‘rectangular triangle’) else
if (a> 90) or (b> 90) or (c> 90) then write (‘obtuse triangle’) else
if (a <90) or (b <90) or (c <90) then write (‘acute triangle’);
end
else write (‘triangle does not exist’);
end.