QBASIC – Easy to find greater number among two numbers

Table of Contents

Overview

Below is the program to find the greater number among any two user-entered numbers.

REM Program to find the greater number among two numbers
CLS
INPUT "Enter the first number: "; a
INPUT "Enter the second number: "; b
IF a > b THEN
  PRINT a; " is greater than ";b
ELSE 
  PRINT b; " is greater than ";a
END IF
END

Output

Greater Number in QBASIC
Outputs 34 is greater than 25 if inputs are 34 and 25

Explanation

To find the greater number among two numbers, ask two numbers from the user and check if the first number is greater than the other using the greater than (>) comparison operator.

More Programs

https://thinkshare.one/learn/programming/qbasic/

Leave a Comment

Your email address will not be published. Required fields are marked *