Wednesday, October 16, 2019

37. Qbasic Program to input distance in kilometre and convert into meter


37.      Write a program to input distance in kilometre and convert into meter using function procedure.

DECLARE FUNCTION CONVERT (K)
CLS
INPUT “ENTER DISTANCE IN KILOMETER”; K
PRINT “DISTANCE IN METER=”; CONVERT (K)
END

FUNCTION CONVERT (K)
M = K * 1000
CONVERT = M
END FUNCTION

No comments:

Post a Comment