Q1- Write a program in QBASIC to input age and print whether eligible to vote
Answers
Answered by
3
Answer:
This is the required program for the question in QBASIC.
10 CLS
20 INPUT "Enter your age: "; A
30 IF A>=18 THEN
40 PRINT "Eligible."
50 ELSE
60 PRINT "Not Eligible.
70 END IF
80 END
Explanation:
- Line 10: Clears the screen.
- Line 20: Ask the user to enter his age.
- Line 30: Check if the age is greater than 18 or not.
- Line 40: If true, person is eligible. Display the result.
- Line 50: Else block.
- Line 60: Person is not eligible. Display the result.
- Line 70: End of if.
- Line 80: End of program.
See the attachment for output.
Attachments:
Answered by
0
Explanation:
INPUT " enter your age " age
if age > =14 THEN
PRINT " you are eligible for rafting. "
ELSE
PRINT "you are not eligible for rafting. "
END IF
Similar questions
Computer Science,
1 month ago
Math,
2 months ago
India Languages,
2 months ago
Physics,
9 months ago
English,
9 months ago