# Program to find the surface area of a cube

Program to find the surface area of a cube on fibonacci, factorial, prime, armstrong, swap, reverse, search, sort, stack, queue, array, linkedlist, tree, graph etc.

## Program to find the surface area of a cube

### Explanation

In this program, we have a cube with equal length, width, and height. We need to find its Surface Area.

A cube is a three-dimensional geometrical figure/container having all its surfaces with equal sides (length, breadth, and height). We have six equal square(surfaces).

Surface Area of Cube = 6 (Surface area of one Square)

Total Surface Area Of Cube = 6( side × side )

### Formula

```Surface Area Of  Cube = 6( a  ×   a )
```

### Algorithm

1. Define equal value for all sides of cube.
2. Use these values in the given formula.
3. Print the Surface Area of Cube.

O(1)

### Python

```l =5
b = 5
h = 5
a=l=b=h
surfacearea =6*(a*a)
print("Surface Area of Cube is : ");
print (surfacearea);
```

Output:

```Surface Area of Cube is: 150
```

### C

```#include<stdio.h>
int main()
{
float  a , l , b, h, surfacearea;
l= 5;
b = 5;
h = 5;
a=l=b=h;
surfacearea = 6*(a*a);
printf("\n\n Surface Area of Cube is : %f", surfacearea);
return (0);
}
```

Output:

```Surface Area of Cube is: 150.00000
```

### JAVA

```public class test1
{
public static void main (String args[])
{   float a, l, b, h, surfacearea;
l = 5;
b =5;
h = 5;
a=l=b=h;
surfacearea  = 6*(a*a);
System.out.println ("Surface Area of Cube is ");
System.out.println(surfacearea);
}}
```

Output:

```Surface Area of Cube is 150.0000
```

### C#

```using System;
class Program
{   static void Main()
{   float a, l,  b, h, surfacearea;
l  = 5;
b= 5;
h =5;
a=l=b=h;
surfacearea =6*(a*a);
Console.WriteLine("Surface Area of Cube is:"+surfacearea);
}}
```

Output:

```Surface Area of Cube is:  150
```

### PHP

```<?php
\$l = 5.0;
\$b = 5.0;
\$h =  5.0;
\$a=\$l=\$b=\$h;
\$surfacearea =6 *(\$a*\$a);
echo("Surface Area of cube is  = ");
echo(\$surfacearea);
?>
```

Output:

```Surface Area of cube is  = 150
```

Next Topic#