Programming Articles - Page 2400 of 3363

C++ Sum Array Puzzle

sudhir sharma
Updated on 04-Oct-2019 07:57:36

274 Views

Array is a data structure that stores multiple elements of the same data type. It can store entire set of values at once. But its length needs to be defined beforehand.In this sum array puzzle, we are given an array A1 of a definite size say n. In order to solve this puzzle, we will create an array called S1 that stores the sum of all elements of the array except the element whose position is being used. For example, if S1[3] is being calculated then we will find the sum of all elements of A1 except the element at ... Read More

Write program to shutdown a system in C/C++

sudhir sharma
Updated on 04-Oct-2019 07:54:57

437 Views

A program to shutdown the system works on the operating systems like windows, linux or macOS. To shut it off and close all opened applications.What shut down or power off means?Shut down or Power off a computer means removing power from a computer's main components in an organised prescribed way and turning off all the works that are done by the computer i.e. all applications and processings are shut off. After a computer is shut down, the main components such as CPU, RAM modules and hard disk drives are powered down, although some internal components, such as an internal clock, ... Read More

C++ program to find the Area of the Largest Triangle inscribed in a Hexagon?

sudhir sharma
Updated on 04-Oct-2019 07:52:34

293 Views

Find the area of largest Triangle inscribed in a hexagon we need to learn these figures are and how 1 is inscribed inside other.Triangle is a closed figure with 3 sides which may be equal or different size.Hexagon is a closed figure with 6 sides which may be equal or unequal in size.A triangle inscribed inside a hexagon has all its vertices touching vertices of hexagon. So, the sides of the triangle can be treated as diagonals of a regular hexagon. The hexagon considered here is a regular hexagon, which leads to make the largest triangle an Equilateral triangle.Let’s derive ... Read More

C++ program to find the Area of the circumcircle of any triangles with sides given?

Ravi Ranjan
Updated on 28-Jul-2025 14:09:31

297 Views

Circumcircle of Triangle A circumcircle of a triangle is a circle that passes through all the vertices of a triangle. The center of circumcircle is known as the circumcenter, which is an intersection of all the perpendicular bisectors of the triangle. The radius is known as the circumradius and is denoted by R. Formula to Calculate Area of Circumcircle of Triangle You can use the formula given below to calculate the area of the circumcircle of a triangle: $$ \frac{\pi (abc)^2}{16K^2} $$ where, a, b, and c are the sides of ... Read More

Angle between two Planes in 3D in C++?

sudhir sharma
Updated on 04-Oct-2019 07:30:39

302 Views

For learning about the angle between two planes in 3D, we need to learn about planes and angles.Plane is a two-dimensional surface that extends to infinity.Angle is the space in degrees between two lines and surfaces which intersect at a point.So, in this problem we need to find the angle between two 3D planes. For this we have two planes that intersect each other and we need to find the angle at which the are intersecting each other.To calculate the angle between two 3D planes, we need to calculate the angle between the normal's of these planes.Here, we have two ... Read More

BFS vs DFS for Binary Tree in C++?

sudhir sharma
Updated on 04-Oct-2019 07:26:55

10K+ Views

BFS (Breadth First Search) − It is a tree traversal algorithm that is also known as Level Order Tree Traversal. In this traversal we will traverse the tree row by row i.e. 1st row, then 2nd row, and so on.DFS (Depth First Search ) − It is a tree traversal algorithm that traverses the structure to its deepest node. There are three most used methods that are used to traverse the tree using DFS. it goes into depth of each node as the root node and then goes to the next one.Solved for a TreeLet’s find the traversal of a ... Read More

Bellman Ford Algorithm in C++?

sudhir sharma
Updated on 04-Oct-2019 07:21:19

4K+ Views

Bellman Ford Algorithm is dynamic programming algorithm which is used to find the shortest path of any vertex computed from a vertex treated as starting vertex. this algorithm follows iterative method and continuously tries to find shortest Path. The Bellman Ford Algorithm on weighted graph.this algorithm was proposed by Alphonso shimbel in 1955. The algorithm has revisions by Richard Bellman and Lester Ford in the year 1956 and 1958, due to this algorithm was named Bellman Ford Algorithm. This algorithm was also revised by Eward F. Moore in 1957, which made its name to Bellman-Ford-Moore Algorithm.This algorithm is better as ... Read More

Array sum after dividing numbers from previous in C?

sudhir sharma
Updated on 04-Oct-2019 07:11:11

273 Views

Array is a sequence of elements of same data type. in this problem we are going to consider integer array for solving the problem. in this problem we are going to find sum of Elements found by dividing the element from the element proceeding it.Let’s take a few examples to understand this Problem better −Example 1 −Array : 3 , 5 ,98, 345 Sum : 26Explanation − 3 + 5/3 + 98/5 + 345/98 = 3 + 1 + 19 + 3 = 26We have divided each element with its preceding element and considered only integer parts of the divisions ... Read More

C++ bitset interesting facts?

sudhir sharma
Updated on 04-Oct-2019 07:08:49

332 Views

C++ programming language defines a container in c++ standard Template Library named as bitset. This bitset container is used in order to work on elements at the bit level i.e. each bit of the variable the bits i.e. binary conversion of the given value.1. Bitset is like an string − Bitset is a container of bits ( only 0 and 1 are valid ). You can create a bitset with any set of bits specified by start index value of the bitset and the number of elements that are considered i.e. you can create a bitset with 2 elements starting ... Read More

C++ bitset and its application ?

sudhir sharma
Updated on 04-Oct-2019 07:05:35

566 Views

A bitset is a dataset that stores multiple boolean values but takes lesser memory space as compared to other data sets that can store a sequence of bits like a boolean array or boolean vector.Bitsets stores the binary bits in a form that takes less memory space, it stores them in compressed from. Accessing any element is same as others i.e. by using its index value i.e. bitset_name[index]. But the indexing of elements in a bitset is reverse. Let’s take an example, for bitset {01101001} the element at 0th index is 1 and so on. So 0’s are at index ... Read More

Advertisements