prev


Getting Input Values From Keyboard

9.Volume of sphere (23.6.2009)

/*
Program# 9
date : 10-12-2008
Volume of Sphere
*/

#include <stdio.h>
main(){
float r,p,c;
p=3.14;
printf("\nEnter value for r : ");
scanf("%f",&r);
c=(4.0/3.0)*p*r*r;
printf("\nVolume of sphere : %.2f\n",c);
}

output:
Enter value for r : 5.0
Volume of sphere : 104.67

next
blog comments powered by Disqus