WAP to find greater number among two numbers

Qbasic program to find greater number among two numbers



CLS
 INPUT “ENTER ANY TWO NUMBERS”; A, B
 IF A > B THEN
 PRINT A; “IS GREATER”
 ELSE
 PRINT B; “IS GREATER”
 END IF
 END

USING SUB


DECLARE SUB GREAT(A,B)
 CLS
 INPUT “ENTER ANY TWO NUMBERS”; A, B
 CALL GREAT(A,B)
 END
 
 SUB GREAT(A,B)
 IF A > B THEN
 PRINT A; “IS GREATER”
 ELSE
 PRINT B; “IS GREATER”
 END IF
 END SUB

Post a Comment

0 Comments