Qbasic program find whether a triangle is equilateral triangle or not
CLS
INPUT “ENTER THREE SIDES OF A TRIANGLE”; A,B,C
IF A = B AND B = C THEN
PRINT “IT IS A EQUILATERAL TRIANGLE”
ELSE
PRINT “IT IS NOT A EQUILATERAL TRIANGLE”
END IF
END SUB
USING SUB
DECLARE SUB EQUILATERAL(A,B,C)
CLS
INPUT “ENTER THREE SIDES OF A TRIANGLE”; A,B,C
CALL EQUILATERAL(A,B,C)
END
SUB EQUILATERAL(A,B,C)
IF A = B AND B = C THEN
PRINT “IT IS A EQUILATERAL TRIANGLE”
ELSE
PRINT “IT IS NOT A EQUILATERAL TRIANGLE”
END IF
END SUB
0 Comments