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 = $((x1−x2)∧2+(y1−y2)∧2)∧(1/2)$((x1−x2)∧2+(y1−y2)∧2)∧(1/2) 40 PRINT "Distance"; Distance; 50 END