A man is using a compass to cross a desert, and he has been given specific directions for his task. Following directions is only permitted: “NORTH”, “EAST”,… Read More
Tag Archives: Basic Coding Problems
Given a number N, the task is to check whether the number is a Sublime number or not. Sublime numbers are defined as positive numbers… Read More
Given two integers L and R, denoting a range [L, R], the task is to find the smallest prime number present in the range. Examples:… Read More
Floyd’s triangle is a triangle with first natural numbers. Task is to print reverse of Floyd’s triangle.Examples: Input : 4 Output : 10 9 8… Read More
You are given the slope of one line (m1) and you have to find the slope of another line which is perpendicular to the given… Read More
Given n points, we need to check if these n points are parallel to X axis or Y axis or to No axis. Examples: Input… Read More
Given the integer N, the task is to print all the numbers less than N, which are divisible by 3 and 5.Examples : Input :… Read More
Given a number n, find the n-th term in the series 1, 4, 27, 16, 125, 36, 343……..Examples: Input : 5 Output : 125 Input… Read More
Given a midpoint of line(m1, m2) and one coordinate of a line (x1, y1), find the other end point(x2, y2) of a line. Examples: Input… Read More
Given the value of length, print the X pattern in a box using # and ” “ Examples: Input : 10 Output : ########## ##… Read More
Given a number n, find the n-th term in the series 3, 13, 42, 108, 235…Examples: Input : 3 Output : 42 Input : 4… Read More
Given n and x, where n is the number of terms in the series and x is the value of the angle in degree. Program to… Read More
Given an array of numbers, print all those elements that are greater than average. Examples: Input : 5, 4, 6, 9, 10 Output : 9… Read More
Following are the common definitions of Binomial Coefficients. A binomial coefficient C(n, k) can be defined as the coefficient of Xk in the expansion of… Read More
Given a number n, find the sum of digits of n when represented in different bases from 2 to n-1.Examples: Input : 5 Output :… Read More