write a program in QBASIC
To take the side of a square from the user as input and find the area and perimeter of a square
Answers
Answered by
8
The given code is written in QBASIC.
CLS
INPUT "Enter side of the square: "; A
PERIMETER = 4 * A
AREA = A ^ 2
PRINT "Perimeter of the square is: "; PERIMETER
PRINT "Area of the square is: "; AREA
END
- Line 1: Clears the screen.
- Line 2: Takes the side of the square as input.
- Line 3: Calculate perimeter of the square using formula.
- Line 4: Calculate area of the square using formula.
- Line 5: Displays the perimeter of the square.
- Line 6: Displays the area of the square.
- Line 7: End of program.
See the attachment for output.
Attachments:
Similar questions
CBSE BOARD XII,
1 month ago
Math,
2 months ago
English,
2 months ago
Math,
9 months ago
English,
9 months ago