![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C Program for Area of a square inscribed in a circle which is inscribed in a hexagon?
Given, A square that is inscribed within a circle that is inscribed in a regular hexagon and we need to find the area of the square, for that we need to find the relation of the side of square and the side of the hexagon.
The mathematical formula for the radius of circle inscribed within the hexagon is, r=A√3/2
Since, the diagonal of square is equal to diameter of the circle, so the relation between the radius and side is, a=√r
Based on the side of hexagon,
a = √3A/√2
So, Area of the Square, Area=a2 = (√3A/√2)2
Example
#include <stdio.h> #include <math.h> int main() { float a = 5; float area = pow((a * sqrt(3)) / (sqrt(2)), 2); printf("area = %f", area); return 0; }
Output
area = 37.500000
Advertisements