Wednesday, October 16, 2019

58. Qbasic program to input three sides of a triangle and determine whether a triangle can be formed or not


58.      Write a sub program to input three sides of a triangle and determine whether a triangle can be formed or not.

DECLARE SUB CHECK (A, B, C)
CLS
INPUT “ENTER THREE SIDES OF A TRIANGLE”; A,B,C
CALL CHECK (A, B, C)
END

SUB CHECK (A, B, C)
IF (A + B) > C AND (B + C) > A AND (A + C) > B THEN
PRINT “THE TRIANGLE CAN BE FORMED”
ELSE
PRINT “THE TRIANGLE CANNOT  BE FORMED”
END IF
END SUB

No comments:

Post a Comment