Server Side Programming Articles - Page 2160 of 2650

Biggest Reuleaux Triangle inscribed within a square which is inscribed within a hexagon in C?

sudhir sharma
Updated on 07-Oct-2019 07:03:02

138 Views

A Reuleaux triangle is a shape formed from the intersection of three circular disks, each having its center on the boundary of the other two. Its boundary is a curve of constant width, the simplest and best known such curve other than the circle itself. Constant width means that the separation of every two parallel supporting lines is the same, independent of their orientation. Because all its diameters are the same.The boundary of a Reuleaux triangle is a constant width curve based on an equilateral triangle. All points on a side are equidistant from the opposite vertex.To construct a Reuleaux ... Read More

Biggest Reuleaux Triangle inscribed within a square inscribed in a semicircle in C?

sudhir sharma
Updated on 04-Oct-2019 08:33:33

157 Views

A Reuleaux triangle is a shape formed by using intersection of three circle, in such a way that each having its center on the boundary of the other two circles. Its boundary is a curve of constant width, the simplest and best known such curve other than the circle itself. Constant width means that the separation of every two parallel supporting lines is the same, independent of their orientation. Because all its diameters are the same.The boundary of a Reuleaux triangle is a constant width curve based on an equilateral triangle. All points on a side are equidistant from the ... Read More

Betrothed numbers in C?

sudhir sharma
Updated on 04-Oct-2019 08:30:08

2K+ Views

Betrothed numbers are pair of two numbers in a way that the sum of their divisors when added by is equal to another number.For example (a,  b) are a pair of betrothed numbers if s(a) = b + 1 and s(b) = a + 1, where s(b) is the aliquot sum of b: an equivalent condition is that σ(a) = σ(b) = a + b + 1, where σ denotes the sum-of-divisors function.The first few pairs of betrothed numbers are: (48,  75), (140,  195), (1050,  1925), (1575,  1648), (2024,  2295), (5775,  6128).All known pairs of betrothed numbers have opposite parity. Any pair of the same parity must exceed 1010.AlgorithmStep 1: Find the sum of all divisors for both numbers. Step 2: Finally ... Read More

C++ program for the Array Index with same count of even or odd numbers on both sides?

sudhir sharma
Updated on 04-Oct-2019 08:27:33

346 Views

Finding the array index with the same count of even or odd number is a number that has equal number of either numbers or odd number on both sides of it i.e. no.s at left = no.s right.Here, we need a few definitions that are related to the concept, Array − A container of elements of same data type.Array Index − The position of an element is called its index. Index of array always start from 0.Even number − A number that is divisible by 2.Odd number − A number that is not divisible by 2.A whole number can either ... Read More

Array elements with prime frequencies in C++?

sudhir sharma
Updated on 04-Oct-2019 08:22:18

271 Views

Array is a container of elements of same data type.Prime Frequencies means that the number of occurrence of the element of the array is a prime number.So, based on these definitions the problem to find array elements with prime frequencies. We are given a string of array. We have to find the frequency of characters and check if frequency is prime and then count elements that have prime frequencies.Let’s take an example, Input: str = “helloworld” Output: 2ExplanationCount of occurrences of characters are −h -> 1 e -> 1 l -> 3 o -> 2 w-> 1 r -> 1 ... Read More

Array element with minimum sum of absolute differences in C++?

sudhir sharma
Updated on 04-Oct-2019 08:08:14

401 Views

This program is to find minimum absolute difference of the array given we have an array which have distinct element.To learn this concept better let’s rebrush the things that required, Array is a container of elements of same data type. The length of an array needs to be predefined.absolute difference is the absolute value of the difference between two numbers i.e. the difference will always be positive, negative values will be converted to positive.The sum of minimum absolute difference of each element has to be found the minimum absolute solute difference formula isMinimum Absolute Difference (a) = min(abs(a – arr[j])) ;where 1 ... Read More

The abs(), labs(), llabs() functions in C/C++

sudhir sharma
Updated on 04-Oct-2019 08:00:18

1K+ Views

What are Integer Functions in C Library?Integer functions are those functions which returns the exact value of an integer. C only supports integer values. In this function the nearest integer which is less than or equal to the argument returns to this function.Types of Integer functions −int = abs (int n); long = labs (long n); long long = llabs (long long n);where n = integer valueWhat is abs(), labs(), llabs() functions ?They are defined as (C Standard General Utilities Library) header file. They give the exact value of integer that is input to them as their argument.abs() function ... Read More

C++ Sum Array Puzzle

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

252 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

408 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

279 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

Advertisements