Server Side Programming Articles - Page 2195 of 2650

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

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

200 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

326 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

197 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

100 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 a hexagon in C Program?

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

137 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

Angle between two Planes in 3D in C Program?

Aman Kumar
Updated on 30-Jul-2025 14:13:45

180 Views

In 3D geometry, planes are flat surfaces extending infinitely in space. When two planes intersect, they form a line, and the angle between them becomes an important geometric measure. In this article, we will learn how to calculate the angle between two planes in 3D space using a C program. The diagram below illustrates two planes intersecting in 3D space. These planes can be represented by the following equations: Equation P1: a1 * x + b1 * y + c1 * z + d1 = 0 P2: a2 * x + b2 * y + c2 * ... Read More

Alphanumeric Abbreviations of a String in C Program?

Arnab Chakraborty
Updated on 20-Aug-2019 11:31:43

544 Views

Here we will see one interesting problem related to alphanumeric abbreviation of a given string. The string length is less than 10. We will print all alphanumeric abbreviations.The alphanumeric abbreviation is in the form of characters mixed with the digits. The value of that digit is number of characters that are missed. There may be any number of skipped substrings. No two substrings are adjacent to each other. Let us see the algorithm to get the idea.AlgorithmprintAbbreviation(s, index, max, str) −begin    if index is same as max, then       print str    end if    add s[index] ... Read More

Adding one to number represented as array of digits in C Program?

Arnab Chakraborty
Updated on 20-Aug-2019 14:25:16

327 Views

In this section we will see one interesting problem. Suppose one number is given. We have to increase this number by 1. This is extremely simple task. But here we will place the number as an array. each digit of that number is placed as an element of the array. If the number is 512, then it will be stored as {5, 1, 2}. And also we have to increase the number using recursive approach. Let us see the algorithm to get the clear idea.Algorithmincrement(arr, n, index) −Initially the default value of index is 0 begin    if index < ... Read More

Cplus plus vs Java vs Python?

Arnab Chakraborty
Updated on 20-Aug-2019 14:22:45

419 Views

Here we will see some basic differences between C++, Java and the Python. At first we will see the C++ and Java differences, then the Java and Python differences.TopicC++JavaMemory ManagementIt uses pointers, structures, unions and referencesIt does not support pointers. It supports references. It also supports Threads, interfacesLibrariesLow level functional librariesWide range of library, with various functionalitiesMultiple InheritanceSupports multiple inheritance using normal classesSupports multiple inheritance with only interfaces (pure abstract classes)Operating OverloadingOperator overloading is supportedDoes not support operator overloadingProgram HandlingFunctions and variables can reside outside of the classesFunctions, variables can only be there inside classes or packagesPortabilityCode is dependent on ... Read More

C++ Program to remove spaces from a string?

sudhir sharma
Updated on 20-Aug-2019 09:02:02

1K+ Views

The program takes a string and removes the spaces in it. This is useful when we want to save the space of our The following sample shows how it is done with an explanation.Input: Hello World Output: HelloWorldExplanationTo remove or delete spaces from the string or sentence, you have to ask the user to enter a string. Now start checking for spaces. If space will be found, then start placing the next character from the space to the back until the last character and continue to check for the next space to remove all the spaces present in the stringExample#include ... Read More

Advertisements