Computer Science, asked by anandprakashinjsr, 2 months ago

Q basic WAP to store distance in cm. Now convert and display it into meter.​

Answers

Answered by anindyaadhikari13
1

\texttt{\textsf{\large{\underline{Solution}:}}}

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

\texttt{\textsf{\large{\underline{Logic}:}}}

  • 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