This repository has been archived on 2023-10-26. You can view files and clone it, but cannot push or open issues or pull requests.
VSMechatronics/LC20/AreaFunc.c

17 lines
355 B
C
Raw Normal View History

#include <stdio.h>
#include <math.h>
float CalculateAreaOfCircle ( float radius )
{
float area;
area = M_PI * radius * radius ;
return (area) ;
}
float CalculateSurfaceAreaOfCylinder ( float radius, float length )
{
float area;
area = 2.0 * ( M_PI * radius * radius ) + ( M_PI * 2.0 * radius * length ); // two ends + side
return (area) ;
}