Search This Blog

Sep 23, 2013

C program to read the radious of sphere and compute its surface area and volume

/* write a program to read the radious of sphere and compute its surface area and volume */
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int r;
float  v,sa;
clrscr();
printf("Inter the radious of sphere please: ");
scanf("%d",&r);
v=4/3*(3.14*pow(r,3));
sa=4*3.14*pow(r,2);
printf("\nVolume of sphere= %.2f",v);
printf("\nSurface area of sphere= %.2f",sa);
getch();
}

No comments:

Post a Comment