Arnab Chakraborty

Arnab Chakraborty

3,768 Articles Published

Articles by Arnab Chakraborty

Page 14 of 377

Baum Sweet Sequence in C Program?

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 256 Views

The Baum Sweet Sequence is a binary sequence where each term is determined by analyzing the binary representation of a number. If a number n has any block of consecutive zeros with odd length in its binary form, then the nth term is 0, otherwise it is 1. For example, if the number is 4, its binary representation is 100. This has one block of two consecutive zeros (even length), so the 4th term of the Baum Sweet sequence is 1. Syntax int baumSweetTerm(int n); Algorithm The algorithm works as follows − ...

Read More

Auxiliary Space with Recursive Functions in C Program?

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 458 Views

Here we will see how auxiliary space is required for recursive function calls and how it differs from normal function calls in terms of memory usage. Syntax returnType functionName(parameters) { // Base case if (condition) return baseValue; // Recursive case return functionName(modifiedParameters); } Recursive Function Example Consider a recursive factorial function − #include long fact(int n) { if (n == 0 || ...

Read More

Array range queries for elements with frequency same as value in C Program?

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 357 Views

In C programming, array range queries for elements with frequency same as value is a problem where we need to find how many elements in a given range appear exactly as many times as their value. For example, if element 3 appears 3 times in the range, it contributes to our answer. Syntax int query(int start, int end, int arr[], int n); Algorithm The approach uses frequency counting within the specified range − Begin create frequency map for elements in range [start, end] count ...

Read More

Area of the biggest possible rhombus that can be inscribed in a rectangle in C Program?

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 228 Views

Here we will see one problem, where one rectangle is given. We have to find the area of largest rhombus that can be inscribed in the rectangle. Rectangle Inscribed Rhombus Length (l) Breadth (b) ...

Read More

Area of squares formed by joining mid points repeatedly in C Program?

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 163 Views

In this problem, we create a series of squares by repeatedly connecting the midpoints of the sides of the previous square. Given an initial square with side length 'a' and the number of iterations 'n', we need to find the area of the nth square. Side = a Side = a/√2 ...

Read More

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

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 204 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 − Length (L) Breadth (B) The largest triangle that can be inscribed within ...

Read More

C Program for area of hexagon with given diagonal length?

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 465 Views

Here we will see how to get the area of one hexagon using diagonal length. The diagonal length of the hexagon is d. d ...

Read More

C Program for area of decagon inscribed within the circle?

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 248 Views

Here we will see how to get the area of a decagon inscribed within a circle. A decagon is a 10-sided polygon, and when inscribed in a circle, all vertices of the decagon lie on the circumference of the circle. Given the radius of the circle, we can calculate the area of the inscribed decagon. .circle { fill: none; stroke: #333; stroke-width: 2; } .decagon { fill: rgba(100, 150, 255, 0.3); stroke: #0066cc; stroke-width: 2; } ...

Read More

Area of circle inscribed within rhombus in C Program?

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 233 Views

In C, we can calculate the area of a circle inscribed within a rhombus using the diagonals of the rhombus. When a circle is inscribed in a rhombus with diagonals 'a' and 'b', the circle touches all four sides of the rhombus. ...

Read More

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

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 172 Views

Here we will see how to find the area of a square inscribed in a circle, which is itself inscribed in a hexagon. Let's say the side of the hexagon is 'A', the radius of the inscribed circle is 'r', and the side of the square is 'a'. A r a Mathematical Relationship For a regular hexagon with side A, the radius of the inscribed ...

Read More
Showing 131–140 of 3,768 articles
« Prev 1 12 13 14 15 16 377 Next »
Advertisements