Reverse Middle X Characters

Given a string str and an integer X. The task is to reverse the middle X characters of the given string and then print the… Read More »

Largest number less than or equal to N/2 which is coprime to N

Given a number N, the task is to find the largest positive integer less than or equal to N/2 which is coprime to N. Note:… Read More »

Print multiples of Unit Digit of Given Number

Given a number . The task is to print the multiples of the unit digit of N from the unit digit of N to N.… Read More »

Biggest Square that can be inscribed within an Equilateral triangle

Given here is an equilateral triangle of side length a. The task is to find the side of the biggest square that can be inscribed… Read More »

Find Pth term of a GP if Mth and Nth terms are given

Given Mth and Nth term of a Geometric progression. Find its Pth term. Examples: Input: m = 10, n = 5, mth = 2560, nth… Read More »

Largest right circular cylinder that can be inscribed within a cone which is in turn inscribed within a cube

Given here is a cube of side length a, which inscribes a cone which in turn inscribes a right circular cylinder. The task is to… Read More »

Biggest Reuleaux Triangle within a Square which is inscribed within a Right angle Triangle

Given here is a right angle triangle with height l, base b & hypotenuse h, which inscribes a square which in turn inscribes a reuleaux… Read More »

Largest square that can be inscribed within a hexagon which is inscribed within an equilateral triangle

Given here is an equilateral triangle of side length a, which inscribes a hexagon which in turn inscribes a square. The task is to find… Read More »

Largest sub-set possible for an array satisfying the given condition

Given an array arr[] and an integer K. The task is to find the size of the maximum sub-set such that every pair from the… Read More »

Recursive program to print all numbers less than N which consist of digits 1 or 3 only

Given an integer N, the task is to print all the numbers ≤ N which have their digits as only 1 or 3. Examples: Input:… Read More »

Program to print Step Pattern

The program must accept a string S and an integer N as the input. The program must print the desired pattern as shown below: Examples:… Read More »

First and Last Three Bits

Given an integer N. The task is to print the decimal equivalent of the first three bits and the last three bits in the binary… Read More »

Program to delete Nth digit of a Number

Given a number num and a number n, the task is to delete this nth digit of the number num, from starting and from end.… Read More »

Maximum number of 3-person teams formed from two groups

Given two integers N1 and N2 where, N1 is the number of people in group 1 and N2 is the number of people in group… Read More »

Minimum elements to be added so that two matrices can be multiplied

Given two matrices A and B of order p x q (or q X p) and r x s ( or s X r). The… Read More »