Computer Science, asked by don1234567890, 1 year ago

Write a program in QBASIC to find out the greater number out of two given numbers.

Answers

Answered by lovingheart
4

A program in QBASIC to find out the greater number :

CLS

       INPUT "ENTER THE FIRST NUMBER";X

       INPUT "ENTER THE SECOND NUMBER";Y

       IF X>Y THEN  

       PRINT " THE GREATEST NUMBER IS";X

       ELSE

       PRINT "THE GREATEST NUMBER IS";Y

       END IF  

       END

In this program, the screen is cleared using “cls”. Then each of the input is obtained from the user. “IF” statement is used to check which is greater and appropriate message is printed to the user. The message is printed along with number.

Similar questions