# Tag Archives: Numbers

## Check if the number is valid when flipped upside down

Given a string str representing a number, the task is to find whether the number is valid or not if it made topsy-turvy i.e upside-down.… Read More »

## Generate N integers satisfying the given conditions

Given an integer N, the task is to generate an array of size N with the following properties: No two elements divide each other. Every… Read More »

## Probability that a N digit number is palindrome

Given an integer N, the task is to find the probability that a number with a number of digits as N is a palindrome. The… Read More »

## Nth Fibonacci number using Pell’s equation

Given an integer N, the task is to find the Nth Fibonacci number. Input: N = 13 Output: 144 Input: N = 19 Output: 2584… Read More »

## First N terms whose sum of digits is a multiple of 10

Given an integer N, the task is to print the first N terms whose sum of digits is a multiple of 10. First few terms… Read More »

## Count of integers in a range which have even number of odd digits and odd number of even digits

Given a range [L, R], the task is to count the numbers which have even number of odd digits and odd number of even digits.… Read More »

## Reduce number to a single digit by subtracting adjacent digits repeatedly

Given a number N, the task is to reduce it to a single-digit number by repeatedly subtracting the adjacent digits. That is, in the first… Read More »

## Count number of bits to be flipped to convert A to B | Set-2

Given two integers A and B, the task is to count the number of bits needed to be flipped to convert A to B. Examples:… Read More »

## Find number of factors of N when location of its two factors whose product is N is given

Given a and b which represents the location of two factors of N whose product is equal to the number N when the factors are… Read More »

## Maximum number of region in which N non-parallel lines can divide a plane

Given N‘, the number of non-parallel lines. The task is to find the maximum number of regions in which these lines can divide a plane.… Read More »

## Find the average of k digits from the beginning and l digits from the end of the given number

Given three integers N, K and L. The task is to find the average of the first K digits and the last L digits of… Read More »

## Sum of digits with even number of 1’s in their binary representation

Given an array arr[] of size N. The task is to find the sum of the digits of all array elements which contains even number… Read More »

## Sum of two numbers if the original ratio and new ratio obtained by adding a given number to each number is given

Given a ratio a : b of two unknown numbers. When both the numbers are incremented by a given integer x, the ratio becomes c… Read More »

## Equal Sum and XOR of three Numbers

Given an integer N. The task is to count the numbers of pairs of integers A and B such that A + B + N… Read More »

## Find the maximum sum of digits of the product of two numbers

Given an array arr[] of size N( > 2). The task is to find the maximum sum of digits of the product of any two… Read More »