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
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
English,
1 month ago
Social Sciences,
1 month ago
Social Sciences,
3 months ago
Computer Science,
3 months ago
Social Sciences,
10 months ago
Physics,
10 months ago
Math,
10 months ago