QBASIC PROGRAM TO FIND THE GREATEST NUMBER AMONG THREE NUMBERS
CLS
INPUT "ENTER ANY THREE NUMBERS"; A, B, C
IF A > B AND A > C THEN
PRINT A; "IS GREATEST"
ELSEIF B > A AND B > C THEN
PRINT B; "IS GREATEST"
ELSE
PRINT C; "IS GREATEST"
END IF
END
USING SUB
DECLARE SUB GREAT(A,B,C)
CLS
INPUT "ENTER ANY THREE NUMBERS"; A, B, C
CALL GREAT(A,B,C)
END
SUB GREAT(A,B,C)
IF A > B AND A > C THEN
PRINT A; "IS GREATEST"
ELSEIF B > A AND B > C THEN
PRINT B; "IS GREATEST"
ELSE
PRINT C; "IS GREATEST"
END IF
END SUB
0 Comments