Home » program to find the surface area of sphere

program to find the surface area of sphere

by Online Tutorials Library

Program to find the surface area of the sphere

The sphere can be defined as the round 3D object having a string of points located at a uniform distance from a particular point called center. It is perfectly symmetrical and has no edges or vertices.

A sphere with radius r has a volume of (4/3) x pie x radius2 and a surface area of 4 x pie x r2.

Formula

Surface area of sphere =   4 x pie x r2  

Algorithm

  1. Define the radius of the sphere.
  2. Define the value of pie.
  3. Calculate the surface area of the sphere by 4 x pie x (radius x radius).
  4. Define surface_sphere and assign the surface area of the sphere to it.

Complexity

O(1)


Solution

C Program

Output:

Surface area of the sphere=17210.285714       

PHP Program

Output:

Surface area of sphere=17210.285714301   

Java Program

Output:

Surface area of sphere=17210.28571430136  

C# Program

Output:

Surface area of sphere=17210.2857143014  

Python Program

Output:

Surface area of the sphere=17210.28571430136      

Next Topic#

You may also like