# 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
Given a number n, find the smallest number that has same set of digits as n and is greater than n. If n is theâ€¦ 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