Skip to content

Category Archives: C++ Programs

Given a number N, the task is to find whether N has an equal number of odd and even factors.Examples:   Input: N = 10 Output: YES Explanation:… Read More
C language has numerous libraries that include predefined functions to make programming easier. In C language, header files contain the set of predefined standard library… Read More
Range-based for loops is an upgraded version of for loops. It is quite similar to for loops which is use in Python. Range-based for loop… Read More
Given a Set of integers sett and an integer index, the task is to find the element in the set which is present at index.… Read More
In this article, we are going to learn try_emplace method in Maps and Unordered Maps. This method was added in C++17 (i.e gcc 9.1) version.… Read More
Library function: These function are the built-in functions i.e., they are predefined in the library of the C. These are used to perform the most… Read More
What is undeclared Error: When we use some constant in our program maybe they are built-in constant and may be created by a user according… Read More
The std::remove_const template of C++ STL is present in the <type_traits> header file. The std::remove_const template of C++ STL is used to get the type… Read More
There is a series of numbers that have only digits, 4 and 7, and numbers are arranged in increasing order. The first few numbers of… Read More
Given an unsorted array arr[] having N elements, the task is to find out the median of the array in linear time complexity. Examples: Input:… Read More
Given a positive integer N, the task is to find the average of cubes of the first N natural numbers. Examples:  Input: N = 2 Output: 4.5 Explanation: For… Read More
Pre-requisite: Policy based data structure Given an array arr[], the task is to find the number of inversions for each element of the array. Inversion… Read More
Prerequisite: Friend Class in C++A friend class can access private and protected members of other classes in which it is declared as a friend. It… Read More
Pre-requisite: Vectors in C++Slicing a vector means to make a subvector from a given vector. Given N integers in a vector arr and to positive numbers… Read More

Start Your Coding Journey Now!