Wednesday, October 16, 2019

53. Qbasic program to enter any two numbers and display the smaller one


53.      Write a program to enter any two numbers and display the smaller one using function procedure.

DECLARE FUNCTION SMALL (A, B)
INPUT “ENTER ANY TWO NUMBERS”; A, B
PRINT “THE SMALLER NUMBER IS”; SMALL (A, B)
END
FUNCTION SMALL (A, B)
IF A < B THEN
SMALL = A
ELSE
SMALL = B
END IF
END FUNCTION

2 comments: