Monday, 20 October 2014

C Program that calculates the Volume of the Sphere

Program:

#include<stdio.h>
#include<conio.h>
#define pi 3.14
void main( )
{
         int r,
         float v;
         printf("\nEnter the radius of the Sphere:");
         scanf("%d",&r);
         v=(4/3)*pi*r*r*r;
         printf("\nVolume of the Sphere is %f",v);
}


Input/Output:

Enter the radius of the Sphere:1

Volume of the Sphere is  4.082000





0 comments:

Post a Comment