# Category Archives: C++ Programs (adsbygoogle = window.adsbygoogle || []).push({});

## Largest hexagon that can be inscribed within an equilateral triangle

Given an equilateral triangle of side length a, the task is to find the largest hexagon that can be inscribed within it. Examples: Input: a… Read More »

## Diagonal of a Regular Hexagon

Given an integer a which is the side of a regular hexagon, the task is to find and print the length of its diagonal. Examples:… Read More »

## Diagonal of a Regular Pentagon

Given an integer a which is the side of a regular pentagon, the task is to find and print the length of its diagonal. Examples:… Read More »

## Area of Reuleaux Triangle

Given an integer h which is the side of an equilateral triangle formed by the same vertices as the Reuleaux triangle, the task is to… Read More »

## Number of pairs whose sum is a power of 2

Given an array arr[] of positive integers, the task is to count the maximum possible number of pairs (arr[i], arr[j]) such that arr[i] + arr[j]… Read More »

## Program to print the given H Pattern

Given an integer N, the task is to print the Alphabet H Pattern as given below: 1 N 2 * 3 3 * 2 N… Read More »

## Calculate area of pentagon with given diagonal

Given an integer d which is the length of the diagonal of a pentagon, the task is to find the area of that pentagon. Examples:… Read More »

## Concatenate suffixes of a String

Given a string str the task is to expand the string as follows: If the string is abcd, the resultant string will be d, cd,… Read More »

## Sort an array of string of dates in ascending order

Given an array of strings dates[], the task is to sort these dates in ascending order. Note: Each date is of the form dd mmm… Read More »

## Reverse middle words of a string

Given a string str, print reverse all words except the first and last words. Examples: Input : Hi how are you geeks Output : Hi… Read More »

## Largest right circular cylinder within a cube

Given a cube of side length a. The task is to find the volume of biggest right circular cylinder that can be inscribed within it.… Read More »

## Find the element having different frequency than other array elements

Given an array of N integers. Each element in the array occurs same number of times except one element. The task is to find this… Read More »

## Check if item can be measured using a scale and some weights

Given some weights of masses a0, a1, a2, …, a100, a being an integer, and a weighing scale where weights can be put on both… Read More »

## Rearrange the given source code

Given a string str which contains the source code (C/C++/Java code) which is not arranged in a proper way, the task is to format that… Read More »

## Find the multiple of x which is closest to a^b

Given three integers a, b and x, the task is to get the multiple of x which is closest to ab. Examples: Input: a =… Read More »