Code Box
-------------------------------------------
/*Program to take the radius of a sphere as input and print
the volume and surface area of the sphere */
#include<stdio.h>
#include<conio.h>
void main()
{
float radius,volume,sarea;
clrscr();
printf("\nEnter radius of circle:");
scanf("%f",&radius);
printf("\nVoume=");
volume=(4/3)*3.413*radius*radius*radius;
printf("%f",volume);
printf("\n\n");
sarea=4*3.412*radius*radius;
printf("\nSurface area = %f",sarea);
printf("\n");
getch();
}
No comments:
Post a Comment