This is a simple HTML + JavaScript project that calculates the area of a circle using the formula:
[ A = r^2 \times \pi ]
- Uses a JavaScript constant
PI = 3.14
- Hard-coded radius
r = 5
(can be changed in the code) - Function calculates the circle area by formula
area = r * r * PI
- Prints result directly into the browser console
- HTML5 β simple page structure
- JavaScript (ES6) β calculation logic
- Clone or download the repository.
- Open
circle_area.html
in any modern browser. - Open the developer console to view the output:
- Chrome/Edge:
F12
orCtrl + Shift + I
β Console tab - Firefox:
Ctrl + Shift + K
- Chrome/Edge:
- You will see the calculation:
