- Trending Categories
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
Found 1401 Articles for C
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
115 Views
Suppose one rectangle is given. We know the length L and breadth B of it. We have to find the area of largest triangle that can be inscribed within that rectangle −The largest triangle will always be the half of the rectangle. So it will beExample#include #include using namespace std; float area(float l, float b) { if (l < 0 || b < 0 ) //if the valuse are negative it is invalid return -1; float area = (l*b)/2; return area; } int main() { float a = 10, b = 8; cout
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
153 Views
Here we will see how to get the area of the circle which is inscribed in N-sided regular polygon. The N (number of sides) are given, and each side of the polygon is ‘a’The approach is simple. One N sided polygon can be divided into N equal triangles, the whole angle for each triangle in center is 360/N, so −Example#include #include using namespace std; float area(float n, float a) { if (n < 0 || a < 0 ) //if the valuse are negative it is invalid return -1; float r = a/(2.0*tan((180/n) ... Read More
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
231 Views
Here we will see how to get the area of one hexagon using diagonal length. The diagonal length of the hexagon is d.The interior angles of a regular hexagon are 120° each. The sum of all interior angles are 720°. If the diagonal is d, then area is −Example#include #include using namespace std; float area(float d) { if (d < 0) //if d is negative it is invalid return -1; float area = (3 * sqrt(3) * d*d)/8.0; return area; } int main() { float r = 10; cout
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
135 Views
Here we will see how to get the area of decagon which is present inside the circle. The radius is given. The side of the decagon is ‘a’.As we know that the side of the decagon is like below −So the area is −Example#include #include using namespace std; float area(float r) { if (r < 0) //if r is negative it is invalid return -1; float area = (5 * pow(r, 2) * (3 - sqrt(5)) * (sqrt(5) + (2 * sqrt(5)))) / 4; return area; } int main() { float r = 8; cout
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
124 Views
Here we will see how to get the area of circumcircle of a right angled triangle. The hypotenuse of the triangle is forming the diameter of the circle. So if the hypotenuse is h, then radius is h/2So the area is −Example Code#include #include using namespace std; float area(float h) { if (h < 0) //if h is negative it is invalid return -1; float area = 3.1415 * (h/2) * (h/2); return area; } int main() { float h = 8; cout
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
210 Views
Here we will see the area of circle which is inscribed in an equilateral triangle. The sides of the triangle are ‘a’.The area of equilateral triangle −The semi-perimeter of the triangle is −So the radius of the circle is −Example#include #include using namespace std; float area(float a) { if (a < 0 ) //if the value is negative it is invalid return -1; float area = 3.1415 * (a/(2*sqrt(3))) * (a/(2*sqrt(3))); return area; } int main() { float a = 4; cout
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
116 Views
Here we will see the area of circle which is inscribed in a rhombus. The diagonals of the rhombus are ‘a’ and ‘b’. The radius of the circle is h.Two diagonals are creating four equal triangles. Each triangle is right-angled triangle, so their area is −Each side of the rhombus is the hypotenuses −So the area of the circle is −Example#include #include using namespace std; float area(float a, float b) { if (a < 0 || b < 0) //if the values are negative it is invalid return -1; float area = (3.1415 ... Read More
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
46 Views
Here we will see the area of a triangle which in inscribed in one rectangle and that circle is inscribed in an ellipse. The half of the major and minor axis are ‘a’ and ‘b’ respectively. Suppose the length of the rectangle is ‘l’ and breadth is ‘h’We know that the area of the rectangle in an ellipse is −The area of the triangle is −Example#include #include using namespace std; float area(float a, float b) { if (a < 0 || b < 0) //if the values are negative it is invalid return -1; ... Read More
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
92 Views
Here we will see the area of a square which in inscribed in one circle and that circle is inscribed in an equilateral triangle. The side of the square is ‘a’. The radius of the circle is ‘r’, and the side of the hexagon is ‘A’. The diagram will be like below.We know that the radius of a circle inscribed in a equilateral triangle is the inradius of the triangle. So the value is −So the diagonal of the square is −So the area of the square is −Example#include #include using namespace std; float area(float A) { //A ... Read More
![Arnab Chakraborty](https://www.tutorialspoint.com/assets/profiles/123881/profile/60_2940367-1661162113.png)
66 Views
Here we will see the area of a square which in inscribed in one circle and that circle is inscribed in a hexagon. The side of the square is ‘a’. The radius of the circle is ‘r’, and the side of the hexagon is ‘A’. The diagram will be like below.We know that the radius of a circle inscribed in a hexagon is −Also the radius of the circle is half of the diagonal of the square. So −Then we can say −Then the area will be −Example#include #include using namespace std; float area(float A) { //A is ... Read More