Thursday 18 August 2016

Volume of Sphere

Volume of Sphere

#include < stdio.h >
#include < math.h >

void main()
{
float radius,pie,volume;
pie=3.1416;

printf("Enter the radius:");
if(scanf("%f",&radius)==1)
{
volume=(4/3)*pie*pow(radius,3);
printf("The volume is :%6.2f",volume);
}
else
{
printf("error ,enter correct value");
}
}

0 comments:

Post a Comment