Found 1401 Articles for C

Area of largest triangle that can be inscribed within a rectangle in C Program?

Arnab Chakraborty
Updated on 20-Aug-2019 12:38:37

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

Area of largest Circle inscribe in N-sided Regular polygon in C Program?

Arnab Chakraborty
Updated on 20-Aug-2019 12:29:48

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

C Program for area of hexagon with given diagonal length?

Arnab Chakraborty
Updated on 20-Aug-2019 12:23:31

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

C Program for area of decagon inscribed within the circle?

Arnab Chakraborty
Updated on 20-Aug-2019 12:19:06

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

Area of Circumcircle of a Right Angled Triangle in C Program?

Arnab Chakraborty
Updated on 20-Aug-2019 12:14:41

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

Area of circle which is inscribed in equilateral triangle in C Program?

Arnab Chakraborty
Updated on 20-Aug-2019 12:09:05

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

Area of circle inscribed within rhombus in C Program?

Arnab Chakraborty
Updated on 20-Aug-2019 12:02:47

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

Area of a triangle inscribed in a rectangle which is inscribed in an ellipse In C Program?

Arnab Chakraborty
Updated on 20-Aug-2019 11:56:52

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

Area of a square inscribed in a circle which is inscribed in an equilateral triangle in C Program?

Arnab Chakraborty
Updated on 20-Aug-2019 11:51:36

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

Area of a square inscribed in a circle which is inscribed in a hexagon in C Program?

Arnab Chakraborty
Updated on 20-Aug-2019 11:46:54

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

Advertisements