Articles on Trending Technologies

Technical articles with clear explanations and examples

Area of circle inscribed within rhombus?

Sharon Christine
Sharon Christine
Updated on 15-Mar-2026 3K+ Views

A circle inscribed in a rhombus touches all four sides of the rhombus. Each side of the rhombus acts as a tangent to the inscribed circle. To find the area of this inscribed circle, we need the lengths of the rhombus diagonals. r a b O ...

Read More

Area of a Circular Sector?

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 1K+ Views

A circular sector (also known as a circle sector or sector of a circle) is the portion of a circle that is enclosed between two radii and an arc. To find the area of a circular sector, we need to determine the central angle between the two radii. r θ Sector Syntax Area = π × r² × (θ / 360°) Where: π (pi) ≈ 3.14159 r = radius of ...

Read More

Area of a circle inscribed in a regular hexagon?

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 3K+ Views

In C programming, calculating the area of a circle inscribed in a regular hexagon involves understanding the geometric relationship between the hexagon and its inscribed circle. A circle inscribed in a regular hexagon touches all six sides of the hexagon at their midpoints. Syntax area = (3 * π * side * side) / 4 Mathematical Formula For a regular hexagon with side length a, the radius of the inscribed circle is r = a(√3)/2. Using the circle area formula A = πr², we get − ...

Read More

C program to find Decagonal Number?

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 193 Views

A decagonal number is a figurate number that represents the number of dots that can be arranged in nested decagonal (10-sided) patterns. These numbers follow the formula 4n² - 3n, where n is the position in the sequence. For example, the 3rd decagonal number involves arranging dots in 3 nested decagons. Each nested layer contributes a specific number of dots, and we subtract the overlapping dots to get the final count. Decagonal Number Pattern ...

Read More

Average of even numbers till a given even number?

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 3K+ Views

To find the average of even numbers till a given even number, we need to sum all the even numbers up to that number and divide by the count of even numbers. Syntax average = sum_of_even_numbers / count_of_even_numbers Example Average of even numbers till 10 is calculated as − Even numbers: 2, 4, 6, 8, 10 Sum: 2 + 4 + 6 + 8 + 10 = 30 Count: 5 Average: 30 ÷ 5 = 6 There are two methods for calculating the average of even numbers till n (where n is ...

Read More

Average of odd numbers till a given odd number?

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 3K+ Views

The average of odd numbers till a given odd number is calculated by finding the sum of all odd numbers from 1 to that number, then dividing by the count of odd numbers. This is a fundamental concept that demonstrates both iterative and mathematical approaches. Syntax Average = Sum of odd numbers / Count of odd numbers Average = (n + 1) / 2 // Formula approach (where n is odd) Example: Manual Calculation For odd numbers till 9: Odd numbers: 1, 3, 5, 7, 9 Sum: 1 + 3 ...

Read More

Power Function in C/C++

Sharon Christine
Sharon Christine
Updated on 15-Mar-2026 1K+ Views

The power function in C is used to calculate the power of a given number. The pow() function finds the value of a raised to the power b i.e., ab. Syntax double pow(double base, double exponent); The pow() function accepts two double values as parameters and returns a double value as output. It is defined in the math.h header file. If you pass integers to the power function, they are automatically converted to double data type. However, there's a potential precision issue with this conversion. Sometimes floating-point representation might store values slightly differently (e.g., ...

Read More

Area of the largest triangle that can be inscribed within a rectangle?

Sharon Christine
Sharon Christine
Updated on 15-Mar-2026 781 Views

A rectangle is a quadrilateral that has opposite sides equal and parallel, with adjacent sides at 90°. A triangle is a closed figure with three sides. The largest triangle that can be inscribed within a rectangle has its base equal to the length of the rectangle and height equal to the breadth of the rectangle. This triangle spans the entire diagonal of the rectangle. Length (l) Breadth (b) Largest Triangle ...

Read More

1's and 2's complement of a Binary Number?

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 5K+ Views

Binary numbers are expressed in base 2, using only the digits '0' and '1'. Each digit in a binary number is called a bit. Understanding 1's and 2's complement is essential for representing signed numbers in computer systems. 1's Complement One's complement of a binary number is obtained by inverting all bits − changing every '0' to '1' and every '1' to '0'. Syntax 1's complement = invert all bits Example: 101100 → 010011 2's Complement Two's complement of a binary number is obtained by adding 1 to the 1's complement of ...

Read More

Sum of the first N Prime numbers

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 3K+ Views

In C programming, finding the sum of the first N prime numbers involves identifying prime numbers sequentially and adding them together. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. Syntax int isPrime(int num); int sumOfFirstNPrimes(int n); Algorithm The approach involves checking each number starting from 2 for primality, and when a prime is found, adding it to the sum until we have found N primes − Start with the first prime number (2) Check each subsequent number for primality Add ...

Read More
Showing 21771–21780 of 61,297 articles
Advertisements