Skip to content

Category Archives: Mathematical

There are n stairs, a person standing at the bottom wants to reach the top. The person can climb either 1 stair or 2 stairs… Read More
Let 1 represent ‘A’, 2 represents ‘B’, etc. Given a digit sequence, count the number of possible decodings of the given digit sequence.  Examples:  Input:… Read More
This problem is known as Clock angle problem where we need to find angle between hands of an analog clock at a given time.Examples:  Input:… Read More
nPr represents n permutation r and value of nPr is (n!) / (n-r)!.  C #include<stdio.h>   int fact(int n) {     if (n <= 1)         return… Read More
Given an integer ‘x’, write a C function that returns true if binary representation of x is palindrome else return false.For example a numbers with… Read More
Given a number ‘n’, find the smallest number ‘p’ such that if we multiply all digits of ‘p’, we get ‘n’. The result ‘p’ should… Read More
You are given a function rand(a, b) which generates equiprobable random numbers between [a, b] inclusive. Generate 3 numbers x, y, z with probability P(x),… Read More
Given a polynomial of the form cnxn + cn-1xn-1 + cn-2xn-2 + … + c1x + c0 and a value of x, find the value… Read More
If inverse of a sequence follows rule of an A.P i.e, Arithmetic progression, then it is said to be in Harmonic Progression.In general, the terms… Read More
Floyd’s triangle is a triangle with first natural numbers.   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  … Read More
Given an integer N. The task is to find the first N Fibonacci numbers. Examples :  Input: n = 3Output: 0 1 1 Input: n… Read More
Given the radius of a circle, find the area of that circle. The area of a circle can simply be evaluated using the following formula. … Read More
Given the sides of a triangle, the task is to find the area of this triangle. Examples :  Input : a = 5, b =… Read More
What is the factorial of a number? Factorial of a non-negative integer is the multiplication of all positive integers smaller than or equal to n.… Read More

Start Your Coding Journey Now!