VOOZH about

URL: https://www.geeksforgeeks.org/dsa/program-volume-surface-area-cube/

⇱ Program for Volume and Surface Area of Cube - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Program for Volume and Surface Area of Cube

Last Updated : 16 Feb, 2023

Cube is a 3-dimensional box-like figure represented in the 3-dimensional plane. Cube has 6 squared-shape equal faces. Each face meet another face at 90 degree each. Three sides of cube meet at same vertex. 
 

👁 cube


Examples: 
 

Input : Side of a cube = 2
Output : Area = 8
 Total surface area = 24

Input : Side of a cube = 3
Output : Area = 27
 Total surface area = 54


 


 

Volume: a*a*a 
Total Surface area: 6*a*a


 

Output: 
 

Area = 125
Total surface area = 150

Time complexity : O(1) 
Auxiliary Space : O(1)


 

Comment