POOL - CPPIOU004

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 Output I prefer centre 1 Test Case 2 Input (stdin) 4 8 Expected Output I prefer centre 2

Program :

#include <iostream>

 using namespace std;

 int main()

 {

 int i,j,k,l;

 cin>>i>>j;

 k=3.14*i*i;

 l=j*j;

{

if (k>l)

 {

cout<<"I prefer centre 1";

 }

 else

 {

cout<<"I prefer centre 2";

 }

}

return 0;

}