Q basic WAP to store distance in cm. Now convert and display it into meter.
Answers
Answered by
1
The given program is written in QBASIC.
CLS
INPUT "Enter distance in cm: "; CM
M = CM / 100
PRINT "After converting to m,distance = "; M; " metre";
END
- Accept length in cm.
- 1 m = 100 cm or 1 cm = 1/100 m
- So, divide the distance entered by 100 and display it.
See the attachment for output.
Attachments:
Similar questions