Calculate the area of a circle given its radius. The formula for the area of a circle is: area = π × radius²
Examples:
Input: radius = 5.0
Output: 78.54
Explanation: Area = π × 5² = π × 25 ≈ 78.54
Input: radius = 3.0
Output: 28.27
Explanation: Area = π × 3² = π × 9 ≈ 28.27
Input: radius = 0.0
Output: 0.0
Explanation: A circle with radius 0 has area 0.
Apex Code Editor
Welcome to Lightning Challenge!
How It Works
- • Write your solution in the code editor
- • Connect your Salesforce org to test
- • Submit to check if your solution passes
- • Use hints if you get stuck
Contest Alert
🏆 #CodeEveryDay July 2026
Contest runs July 1 - 31. Complete challenges to climb the leaderboard!
Only the 31 daily challenges shown during this contest count toward points. Earlier dailies don't carry over.