Accept two numbers from the user and display the larger one in QB64
Answers
Answered by
3
The given problem is solved in QBASIC. Here I have assumed that the numbers entered are not same.
CLS
INPUT "Enter first number: "; A
INPUT "Enter second number: "; B
IF A > B THEN
MAX = A
ELSE
MAX = B
END IF
PRINT "Largest Number: "; MAX
END
- Accept two numbers.
- Use if else to calculate the larger number and store it in variable 'max'.
- Display 'max'.
See attachments for output.
Attachments:
Similar questions