7. C Program To find the area of sphere.
How does this program work?
- In this program you are going to learn about How to find out the Area of triangle if 3sides are given C language.
- Take User inputs for lengths of 3sides of a triangle.
- And Store them in variables to find out the final answer and display it using C language.
Here is the code
#include <stdio.h>
int main(void)
{
//To find the area of sphere
int r;
float pi=3.14,area;
printf("Enter the Radius of a sphere:\n",r);
scanf("%d",&r);
area = 4*pi*(r*r);
//formula for area of sphere
printf("Area of a sphere is: %f\n",area);
return 0;
}