Skip to content

adjust radius value so that calculated areaOfCircle is correct #877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SachinMS4
Copy link

@SachinMS4 SachinMS4 commented Oct 3, 2023

For variable radius, value assigned is 10.
This variable is further used to calculate area of circle using formula PI*radius*radius. The result is stored in another variable called areaOfCircle.

The result is logged like below:
condole.log(areaOfCircle) // 314 metres

Since the value assigned for radius is 100, the expression PI*radius*radius results into 31400 metres.
To fix this, I have adjusted radius value to 10. So the result will be 314 metres.

For variable radius value assigned is 10.
This variable is further used calculate area of circle using formula  PI*radius*radius. The result is stored in another variable called areaOfCircle.
The result is logged as below 
condole.log(areaOfCircle)  // 314 metres
Since the value assigned for radius is 100, the PI*r*r results into 31400 metres.
To fix this, I have adjusted radius value to 10. Now the result will be 314 metres.
Copy link

@adamusek-007 adamusek-007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants