program 1 : Accept dimensions of cylinder and print surface area and volume of cylinder. #include<stdio.h> void main() { ...

C Program to find surface area and volume of cylinder.



program 1 : Accept dimensions of cylinder and print surface area and volume of cylinder.
#include<stdio.h>
void main()
{
 int h,r;
 float PI=3.14, area, volume;
 printf("Enter  dimensions for  cylinder:");
 scanf("%d%d",&r,&h);
 area=2*PI*r*r+1*PI*r*h;
 volume=PI*r*r*h;
 printf("\nSurface area=%f",area);
 printf("\nVolume=%f",volume);
}

Output
[root@localhost Desktop]#  gcc cylinder.c
[root@localhost Desktop]# ./a.out
Enter  dimensions for  cylinder:4 6
Surface area=175.839996
Volume=301.440002   ✔ 👀


0 coment�rios:

HTML5 CSS3 TUTORIAL FOR BEGINNERS