Write a program in QBASIC to input 2 number and display the smallest number
Answers
Answered by
13
Answer:
This is the required QBASIC program for the question.
CLS
INPUT "Enter first number: "; A
INPUT "Enter second number: "; B
IF A > B THEN
PRINT "First number is greater than the second."
ELSEIF A < B THEN
PRINT "Second number is greater than the first number."
ELSE
PRINT "Both are equal."
END IF
END
Algorithm:
- Enter two numbers.
- Check if first number is greater than the second number. If true, display the message that - "First number is greater than the second."
- Check if second number is greater than the first number. If true, display the message that - "Second number is greater than the first." or else display the message that - "Both are equal."
Refer to the attachment.
•••♪
Attachments:
Answered by
10
Answer:
CLS
PRINT "ENTER 2 NUMBERS"
INPUT A
INPUT B
IF A>B
PRINT "SMALLEST NUMBER:";B
ELSE IF B>A
PRINT " SMALLEST NUMBER:";A
ELSE
PRINT " TWO NUMBERS ARE EQUAL"
END
Similar questions