Write the program in QBASIC to take the side of a cube as 5.Find and print its volume
Answers
Answered by
1
Solution.
The given code is written in QBASIC.
CLS
SIDE = 5
PRINT "Side of the cube is: "; SIDE
VOLUME = SIDE ^ 3
PRINT "Volume of the cube is: "; VOLUME
END
Explanation.
- Line 1: Clears the screen.
- Line 2: Initialise the side of the cube.
- Line 3: Displays the side of the cube.
- Line 4: Calculates the volume of the cube using formula.
- Line 5: Displays the volume of the cube.
- Line 6: End of program.
See attachment for output.
Attachments:
Similar questions