Esempio n. 1
0
int main ()
{
	double xCenter, yCenter, xPoint, yPoint;
	scanf( "%lf %lf %lf %lf", & xCenter, & yCenter, & xPoint, & yPoint );

	double radius = getDistance( xCenter, yCenter, xPoint, yPoint );
	printf( "Circle area - %lf\n", circleArea( radius ) );
	return 0;
}
int main(int argc, char *argv[]) {
	double r;
	printf("What is the radius of circle: ");
	scanf("%lf", &r);
	printf("|%-10s|%10s|%10s|\n","r", "perimeter", "area");
	printf("|%-10.2lf|%10.2lf|%10.2lf|\n", r, circlePerimeter(r), circleArea(r));
	
	return 0;
}
Esempio n. 3
0
int main(void) {

	float r, result;

	printf("Enter a radius: ");
	scanf("%f", &r);
	
	result = circleArea(r);
	printf("The area is %.2f.\n", result);

return 0;
}
Esempio n. 4
0
double cylinderCapacity(const Cylinder* c)
{
	if (!c || c->radius < 0 || c->height < 0) { return -1; }
	return circleArea(c->radius) * c->height;
}
Esempio n. 5
0
double cylinderSurface(const Cylinder* c)
{
	if (!c || c->radius < 0 || c->height < 0) { return -1; }
	return 2 * circleArea(c->radius) + cylinderLateralArea(c);
}