Given coordinates of 3 cells (X1, Y1), (X2, Y2) and (X3, Y3) of a matrix. The task is to find the minimum path which connects… Read More
Category Archives: C++ Programs
Given a binary number as string, find its decimal equivalent.Examples: Input : binary = "101" Output : 5 Input : binary = "1111" Output :… Read More
Given a regular polygon of N sides with radius(distance from the center to any vertex) R. The task is to find the area of the… Read More
Given a regular polygon of N sides with side length a. The task is to find the area of the polygon. Examples: Input : N =… Read More
Given an integer a which is the side of a regular decagon, the task is to find and print the length of its diagonal. Examples: … Read More
Given an integer a which is the side of a regular heptagon, the task is to find and print the length of its diagonal. Examples: … Read More
Given two integer and , the task is to find the count of common factors of two numbers where factors are prime.Examples: Input: A = 6, B… Read More
Given a string with repeated characters, we have to insert a star i.e.” * “ between pair of adjacent identical characters using recursion. Examples: Input… Read More
Given an integer a which is the side of a square, the task is to find the biggest Reuleaux Triangle that can be inscribed within… Read More
Given an integer n which is the number of hours, the task is to convert it into minutes and seconds.Examples: Input: 5 Output: Minutes = 300,… Read More
Given integers k, d1, d2 and an integer array arr[]. Starting from number k you are allowed to make jumps of size d1 and d2… Read More
Given a string str, the task is to split the string into minimum parts such that each part is of same length and each part… Read More
Given side of a square a, the task is to find the side of the largest hexagon that can be inscribed within the given square.Examples: … Read More
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
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: Input:… Read More