Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
Program to calculate the area of an Circle inscribed in a Square
A circle inscribed in a square is a circle which touches all four sides of the square. The diameter of the inscribed circle is equal to the side of the square. The area can be calculated using the formula (?/4) × a² where 'a' is the length of side of square.
Syntax
area = (?/4) × a²
Where:
- a = side length of the square
- ? = mathematical constant (approximately 3.14159)
Example
This program calculates the area of a circle inscribed in a square −
#include <stdio.h>
int main() {
int a = 5;
float area;
float pi = 3.14159;
printf("Program to find area of circle inscribed inside a square<br>");
printf("The side of the square is %d<br>", a);
area = (pi/4) * a * a;
printf("The area of circle inscribed inside a square is %.2f<br>", area);
return 0;
}
Program to find area of circle inscribed inside a square The side of the square is 5 The area of circle inscribed inside a square is 19.63
How It Works
The formula derives from the basic circle area formula ? × r², where the radius r equals a/2 (half the side length). Substituting:
- Circle area = ? × r²
- Since r = a/2, we get: ? × (a/2)²
- Simplifying: ? × a²/4 = (?/4) × a²
Conclusion
The area of a circle inscribed in a square is always (?/4) times the square of the side length. This relationship is constant regardless of the square's size.
Advertisements
