Computer Science, asked by heanishmaghnani1857, 5 hours ago

Write the program in QBASIC to take the side of a cube as 5.Find and print its volume

Answers

Answered by anindyaadhikari13
1

Solution.

The given co‎‎de 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.

  1. Line 1: Clears the screen.
  2. Line 2: Initialise the side of the cube.
  3. Line 3: Displays the side of the cube.
  4. Line 4: Calculates the volume of the cube using formula.
  5. Line 5: Displays the volume of the cube.
  6. Line 6: End of program.

See attachment for output.

Attachments:
Similar questions