Given a number n, print all primes smaller than or equal to n. It is also given that n is a small number. For example,… Read More
Given a number n, print all primes smaller than or equal to n. It is also given that n is a small number. For example, if… Read More
Given a number n, print all primes smaller than or equal to n. It is also given that n is a small number. For example,… Read More
Given a number n, print all primes smaller than or equal to n. It is also given that n is a small number. Example: … Read More
Given an unsorted array and a number n, find if there exists a pair of elements in the array whose difference is n. Examples: Input:… Read More
A magic square of order n is an arrangement of n2 numbers, usually distinct integers, in a square, such that the n numbers in all… Read More
Given an array that contains both positive and negative integers, find the product of the maximum product subarray. Expected Time complexity is O(n) and only… Read More
Given a number n, write a function that returns count of numbers from 1 to n that don’t contain digit 3 in their decimal representation.… Read More
Given three corner points of a triangle, and one more point P. Write a function to check whether P lies within the triangle or not.… Read More
Copy elision (or Copy omission) is a compiler optimization technique that avoids unnecessary copying of objects. Now a days, almost every compiler uses it. Let… Read More
Write a program to find sum of positive integers without using any operator. Only use of printf() is allowed. No other library function can be… Read More
Like functions, we can also pass variable length arguments to macros. For this we will use the following preprocessor identifiers. To support variable length arguments… Read More
In this post, we will try to cover many ambiguous questions like following. Guess the output of following programs. filter_none edit close play_arrow link brightness_4… Read More
Predict the output of following C++ programs. Question 1 filter_none edit close play_arrow link brightness_4 code #include<iostream> #include<string.h> using namespace std; class String {… Read More
Given a partially filled 9×9 2D array ‘grid[9][9]’, the goal is to assign digits (from 1 to 9) to the empty cells so that every… Read More
Featured Articles
View All