Answer to Question #103264 in Programming & Computer Science for Ena

Question #103264
Write a Qbasic program to read in the radius r of a circle, centered at the origin. then read in the coordinate pair(x, y) of a point and determine that point lies within the circle.
1
Expert's answer
2020-02-21T09:47:12-0500
' qbasic.net/en/qbasic-tutorials/beginner/qbasic-beginner-2.htm
CLS
INPUT "Enter the radius of a circle in the origin "; rad
INPUT "Enter the coordinates of a point "; px, py
diff = px * px - rad * rad + py * py
IF diff < 0 THEN
    PRINT "Yes, it lies within the circle"
ELSE
    PRINT "No, it doesn't lie within the circle"
END IF

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS