VOOZH about

URL: https://www.geeksforgeeks.org/dsa/c-program-find-area-circle/

⇱ Program to find area of a circle - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Program to find area of a circle

Last Updated : 27 Dec, 2024

Given the radius r. Find the area of a circle. The area of the circle should be correct up to 5 decimal places.

👁 area_of_circle

Examples:

Input: r = 5
Output: 78.53982
Explanation: As area = PI * r * r = 3.14159265358979323846 * 5 * 5 = 78.53982, as we only keep 5 digits after decimal.

Input: r = 2
Output: 12.56637
Explanation: As area = PI * r * r = 3.14159265358979323846 * 2 * 2 = 12.56637, as we only keep 5 digits after decimal.

The area of a circle can be calculated using the formula: area = PI * r * r


Output
78.53982

Time Complexity: O(1)
Auxiliary Space: O(1), since no extra space has been taken.

Comment