c ProgrammingProgrammes

Write a Program to Find Sphere Surface Area and Volume of a Sphere

By April 3, 2016 November 16th, 2019 No Comments

/*Program to find Sphere Surface Area and Volume of a Sphere
Sphere Surface Area = 4 * PI * r * r
Volume of Sphere = (4/3) * PI * r * r * r*/
#include <stdio.h>
#define PI 3.142
main()
{
float r, area, vol;
printf(“\nEnter radius of Sphere: “);
scanf(“%f”, &r);
area = 4 * PI * r * r;
vol = (4/3) * PI * r * r * r;
printf(“\nSphere Surface Area = %.2f”, area);
printf(“\nVolume of Sphere = %.2f”, vol);
getch();
}

Leave a Reply