Q basic WAP to store time in hour. Now convert and display it into seconds.
Answers
Answered by
2
The given code is written in QBASIC.
CLS
INPUT "Enter time in hour: "; HR
SEC = HR * 3600
PRINT "Time in seconds ="; SEC
END
- Line 1: Clears the screen.
- Line 2: Accept time in hours from the user.
- Line 3: 1 hour is equal to 3600 seconds. So, multiply hour by 3600 to get time in seconds. Store the result in variable 'SEC'.
- Line 4: Display the time in seconds.
- Line 5: End of program.
See the attachment for output.
Attachments:
Similar questions