KnowledgeBoat Logo
|

Computer Studies

Write a program in QBASIC format to accept the length of a rod in millimetres and express the same in centimetres and metres.

QBASIC

QBASIC: Input Statement

19 Likes

Answer

Cls
Input "Enter the length of the rod in mm "; L
Let Lcm = L / 10
Let Lm = L / 1000
Print "Length of rod = "; L; " mm"
Print "Length in centimetres = "; Lcm; " cm"
print "Length in metres = ";Lm ; " m"
End

Output

Enter the length of the rod in mm ? 3000
Length of rod = 3000 mm
Length in centimetres = 300 cm
Length in metres = 3 m

Answered By

9 Likes


Related Questions