Problem Description
You are planning to go for swimming classes. You would prefer to enroll in the center which has the swimming pool of a greater area. In the first centre that you visit, the swimming pool is a circular shape(radius-r). In the next centre that you visit, the swimming pool is of a square shape (side-S). Write a program that will help you to make the choice of the swimming pool.
Input :
Input consists of 2 integers. The first integer correspond to the radius (r) of the circular swimming pool, The second integer corresponds to the side (S) of the square swimming pool.Test Case 1
Input (stdin)4 4
Expected OutputI prefer centre 1
Test Case 2
Input (stdin)4 8
Expected OutputI prefer centre 2
Program
#include <stdio.h> int main() { int r,s,square; scanf("%d%d",&r,&s); square=s/r; printf("I prefer centre %d",square); return 0; }
No comments:
Post a Comment
Note: only a member of this blog may post a comment.