Computer Science, asked by akshita5046, 3 months ago

Answer the following questions:
a) Write a program in QBASIC to input side of a square and print perimeter of square.


pls send the answer fast​

Answers

Answered by anindyaadhikari13
1

Required Answer:-

Question:

  • Write a program in QBASIC to input side of a square and print perimeter of the square.

Solution:

Here comes the program.

10 CLS

20 INPUT "Enter Side Of Square: "; S

30 LET A = 4*S

40 PRINT "Perimeter Of The Square is: "

50 PRINT A

60 END

Explanation:

  1. Line 10: Clears the screen.
  2. Line 20: Ask the user to input the side.
  3. Line 30: Perimeter is equal to 4 times the side of the square. Store perimeter in variable A.
  4. Line 40: Print the message.
  5. Line 50: Print the perimeter.
  6. Line 60: Ends the program.
Similar questions