Arnab Chakraborty

Arnab Chakraborty

3,768 Articles Published

Articles by Arnab Chakraborty

Page 177 of 377

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

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 164 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 206 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 481 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 256 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 235 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 174 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

Alphanumeric Abbreviations of a String in C Program?

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

In C programming, generating alphanumeric abbreviations of a string means creating all possible combinations where some characters can be replaced with numbers representing the count of omitted characters. For example, "HELLO" can be abbreviated as "HE2O" where "2" represents the two omitted characters "LL". Syntax void printAbbreviation(const char* s, int index, int max_index, char* str, int str_len); Algorithm The recursive algorithm works as follows − printAbbreviation(s, index, max, str) − begin if index is same as max, then print str ...

Read More

Addition and Subtraction of Matrix using pthreads in C/C++

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 1K+ Views

Matrix addition and subtraction using pthreads allows us to perform operations on large matrices efficiently by utilizing multiple threads. Each thread handles a portion of the matrix, enabling parallel computation and improved performance. To compile and run pthread programs, you need to link with the pthread library using: gcc -pthread program.c -o program Syntax pthread_create(&thread_id, NULL, function_name, (void*)argument); pthread_join(thread_id, NULL); Example: Matrix Operations with Pthreads This example demonstrates matrix addition and subtraction using multiple threads. Each thread processes one row of the matrices − #include #include #include ...

Read More

C/C++ Program to Find sum of Series with n-th term as n power of 2 - (n-1) power of 2

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

Here we will see how to get the sum of the series with n-th term as n2 − (n−1)2. The recurrence relation is like below − Tn = n2 − (n−1)2 So the series is − S = T₁ + T₂ + T₃ + ... + Tₙ S = (1² - 0²) + (2² - 1²) + (3² - 2²) + ... + (n² - (n-1)²) S = 1 + 3 + 5 + ... + (2n-1) = n² We need to find S mod (109 + 7), ...

Read More

Types of Polymorphisms - Ad-hoc, Inclusion, Parametric & Coercion

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 4K+ Views

Polymorphism is a fundamental concept in programming that allows entities to take multiple forms. There are four main types of polymorphism − Ad-Hoc Polymorphism (Function Overloading) Inclusion Polymorphism (Subtyping) Parametric Polymorphism (Generics/Templates) Coercion Polymorphism (Type Casting) Note: This article explains polymorphism concepts using C syntax for illustration. Pure C doesn't support object-oriented polymorphism natively, but these concepts can be demonstrated through function pointers and other techniques. Ad-Hoc Polymorphism (Function Overloading) Ad-hoc polymorphism allows multiple functions with the same name to operate on different data types. In C, this is achieved through different ...

Read More
Showing 1761–1770 of 3,768 articles
« Prev 1 175 176 177 178 179 377 Next »
Advertisements