Skip to content

Category Archives: C++ Programs

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
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
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
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
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
Given string str the task is to expand the string as follows: If the string is abcd, the resultant string will be d, cd, bcd, and… Read More
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 yyyy… Read More
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
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.Examples:  … Read More
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
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
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
Given three integers a, b and x, the task is to get the multiple of x which is closest to ab.Examples:   Input: a = 5,… Read More
99.9% of the C++ programs use macros. Unless you are making a basic file you have to write #include, which is a macro that pastes… Read More
Given an array of distinct integers arr[], the task is to find a pair which has the minimum sum and print the sum.Examples:   Input: arr[]… Read More

Start Your Coding Journey Now!