Wednesday, October 16, 2019

54. Qbasic program to enter any three numbers and display the smallest one

54.      Write a program to enter any three numbers and display the smallest one using function procedure.

DECLARE SUB SMALL (A, B, C)
CLS
INPUT “ENTER ANY THREE NUMBERS”; A, B, C
CALL SMALL (A, B, C)
END
SUB SMALL (A, B, C)
IF A < B AND A < C THEN
S = A
ELSEIF B < A AND B < C THEN
S = B
ELSE
S = C
END IF
PRINT “THE SMALLEST NUMBER IS “; S
END SUB

No comments:

Post a Comment