1.

Write a qbasic program to calculate and print the area of a circle after accepting radius from user.hint: area=3.14* radius*radius

Answer»

Answer:

This is the required QBASIC program for the question.

10 CLS

20 INPUT "ENTER the Radius: "; R

30 LET A = 3.14 * R * R

40 PRINT "Area of the circle is: "

50 PRINT A

60 END

Explanation:

  1. Line 10: Clears the screen. CLS is used to clear the screen.
  2. Line 20: Take the radius as input from the user. To take input, INPUT statement is used.
  3. Line 30: Calculates the area and store the result in variable named - 'A'.
  4. Line 40: Display the MESSAGE that - "Area of the TRIANGLE is: ". To display message, the print statement is used.
  5. Line 50: Display the area.
  6. Line 60: Ends the program. To end the program, END statement is used.

See the attachment for output ☑.



Discussion

No Comment Found