Computer Science, asked by arnav6331, 1 month ago

Accept two numbers from the user and display the larger one in QB64

Answers

Answered by anindyaadhikari13
3

\texttt{\textsf{\large{\underline{The C{o}de}:}}}

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

\texttt{\textsf{\large{\underline{Logic}:}}}

  • 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