Write a program to find the area and volume of a sphere.

 In this program, we calculate the area and volume of the sphere from its radius.

 This post content

  • Algorithm
  • Flowchart
  • C code
  • Output
  • Pdf notes


Algorithm:-

Step 1:-start.

Step 2:-declare the variables pi, r area, and volume.

Step 3:-read the variables pi and r.

Step 4:-calculate the area and volume of a sphere, 

By using:-

area =4 * pi r * r.

Volume = 4/3*pi*r*r*r.

Step 5:-print area and volume.

Step 6:-end.


Flowchart:-


C code:-


Output:-







Tyr it yourself:-

Online c compiler


Download pdf notes here.





Comments

Popular posts from this blog

Develop and execute C Program to Add Two Distances given in kilometer-meter Using Structures.

Develop a c program to find the sum of all elements stored in a given array using a pointer.