Computer Science, asked by harshch2208, 10 days ago

Write a program to accept a number from the user and display the message 'EVEN NUMBER
if the number is a multiple of 2 or 'ODD NUMBER' if the number is not a multiple of 2.
write in qbasic language.
spam answers will be reported. ​

Answers

Answered by anindyaadhikari13
1

Answer:

The given program is written in QBASIC.

CLS

INPUT "Enter a number:"; A

IF A MOD 2 = 0 THEN

   PRINT "EVEN NUMBER"

ELSE

   PRINT "ODD NUMBER"

END IF

END

Algorithm:

  • Accept the number.
  • Perform modulo operation and get the remainder obtained when the number is divided by 2.
  • If the remainder is 0, print the message that "EVEN NUMBER" or else print "ODD NUMBER"

Refer to the attachment for output.

•••♪

Attachments:
Similar questions