Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to find volume of sphere

Posted By: Reuben Brown     Category: C Programming     Views: 9698

Write a program to find volume of sphere.

Code for Program to find volume of sphere in C Programming

#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");
        }

}
==================================OUTPUT==================================

Enter the radius :2.13
The volume  is   :30.36
  
Share: 


Didn't find what you were looking for? Find more on Program to find volume of sphere Or get search suggestion and latest updates.

Reuben Brown
Reuben Brown author of Program to find volume of sphere is from London, United Kingdom.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!