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
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:
- Line 10: Clears the screen.
- Line 20: Ask the user to input the side.
- Line 30: Perimeter is equal to 4 times the side of the square. Store perimeter in variable A.
- Line 40: Print the message.
- Line 50: Print the perimeter.
- Line 60: Ends the program.
Similar questions