Greatest among 3 numbers
DECLARE SUB GREAT(A,B,C)
CLS
INPUT"ENTER FIRST NUMBER";A
INPUT"ENTER SECOND NUMBER";B
INPUT"ENTER THIRD NUMBER";C
CALL GREAT(A,B,C)
END
SUB GREAT(A,B,C)
IF A>B AND A>C THEN
PRINT"THE GREATEST NUMBER IS";A
ELSEIF B>A AND B>C THEN
PRINT"THE GREATEST NUMBER IS ";B
ELSE
PRINT"THE GREATEST NUMBER IS";C
END IF
END SUB
CLS
INPUT"ENTER FIRST NUMBER";A
INPUT"ENTER SECOND NUMBER";B
INPUT"ENTER THIRD NUMBER";C
CALL GREAT(A,B,C)
END
SUB GREAT(A,B,C)
IF A>B AND A>C THEN
PRINT"THE GREATEST NUMBER IS";A
ELSEIF B>A AND B>C THEN
PRINT"THE GREATEST NUMBER IS ";B
ELSE
PRINT"THE GREATEST NUMBER IS";C
END IF
END SUB
Comments
Post a Comment