Volume of sphere

Program:

#include<stdio.h>
int main()
{
float r,pi=3.14,v;
printf("Enter radius of sphere: ");
scanf("%f",&r);
v=(4*pi*r*r*r)/3;
printf("Volume of sphere: %.2f\n",v);
return 0;

}

Output:



No comments:

Post a Comment

x^y using recursion

Program: #include<stdio.h> int power(int a,int b); int main() { int x,y,ans; printf("Enter x and y:\n "); scanf(...