#include <stdio.h>
#include <stdlib.h>
#include <math.h>
float output()
{
float r, h, surface_area;
printf("Enter the radius of the cylinder:-\n");
scanf("%f", &r);
printf("Enter the height of the cylinder:-\n");
scanf("%f", &h);
surface_area = (2 * M_PI * r * h) + (2 * M_PI * r * r); //M_PI is MATH CONSTANT PI
return surface_area;
}
float main()
{
system("cls");
float dis;
dis = output();
printf("Surface area of cylinder is:- %f", dis);
return 0;
}
//........Coded by YASH ALLAPURIA
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP