wiz-icon
MyQuestionIcon
MyQuestionIcon
5
You visited us 5 times! Enjoying our articles? Unlock Full Access!
Question

Write a program in BASIC to find the distance between two points using the INPUT keyword.

Open in App
Solution

10 REM 'Distance between two points"
20 INPUT "Enter the values for x1,y1x1,y1 and x2,y2x2,y2", x1,y1,x2,y2$x1,y1,x2,y2
30 LET Distance = $((x1x2)2+(y1y2)2)(1/2)$((x1−x2)∧2+(y1−y2)∧2)∧(1/2)
40 PRINT "Distance"; Distance; 50 END

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Exploring Index Numbers
STATISTICS
Watch in App
Join BYJU'S Learning Program
CrossIcon