Sunidhi Bansal has Published 1100 Articles

Count divisors of n that have at-least one digit common with n in Java

Sunidhi Bansal

Sunidhi Bansal

Updated on 06-Jun-2020 12:18:23

144 Views

We are given with a number let’s say, num and the task is to calculate the divisor of a given number thereby count the divisors of num that have at least one digit common with n.Input − num = 24Output − Count is 4Explanation − we will perform the following ... Read More

Count natural numbers whose all permutation are greater than that number in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 06-Jun-2020 12:11:50

292 Views

We are given a natural number let’s say, num and the task is to calculate the count of all those natural numbers whose all permutations are greater than that number.We are working with the following conditions −The data should be natural numbers onlyAll the possible permutations or arrangement of a ... Read More

Count elements smaller than or equal to x in a sorted matrix in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 06-Jun-2020 12:08:17

126 Views

We are given a matrix of size n x n, an integer variable x, and also, the elements in a matrix are placed in sorted order and the task is to calculate the count of those elements that are equal to or less than x.Input −matrix[3][3] = {{1, 2, 3}, ... Read More

Count Number of animals in a zoo from given number of head and legs in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 06-Jun-2020 12:04:31

875 Views

We are given a total number of heads and legs in a zoo and the task is to calculate the total number of animals there in the zoo with the given data. In the below program we are considering animals to be deer and peacocks.Input −heads = 60 legs = ... Read More

Count frequency of k in a matrix of size n where matrix(i, j) = i+j in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 06-Jun-2020 12:00:30

215 Views

We are given a matrix of integer values and the task is to calculate the count of the frequency of a given integer variable let’s say, k in the matrix. The size of a matrix can depend upon the size the user wants and in the below program we are ... Read More

Count n digit numbers not having a particular digit in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 06-Jun-2020 11:56:53

155 Views

We are given a number let’s say, num and a total number of digits stored in an integer type variable let’s say, digi and the task is to calculate the count of those n digits numbers that can be formed where the given digit is not there.Input − n = ... Read More

Count digits in given number N which divide N in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 06-Jun-2020 11:53:47

2K+ Views

We are given a number let’s say, N and the task is to find the count of those digits in a number that divides the number N.Points to be rememberIf the digit is 0 then it should be ignored which means count will not be increased for 0.If a digit ... Read More

Count n digit numbers divisible by given number in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 06-Jun-2020 11:51:27

282 Views

We are given the two elements let’s say, d and num, the task is to find the d digit numbers which are divisible by num.In simple words let us suppose we have given an input 2 in d, so we will first find all the 2-digit numbers i.e. from 10-99 ... Read More

Count entries equal to x in a special matrix in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 06-Jun-2020 11:49:25

258 Views

Given a square matrix, mat[][] let the elements of the matrix me mat[i][j] = i*j, the task is to count the number of elements in the matrix is equal to x.Matrix is like a 2d array in which numbers or elements are represented as rows and columns.So, let's understand the ... Read More

Maximum area of rectangle possible with given perimeter in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 06-Jun-2020 11:44:04

278 Views

Given a perimeter of a rectangle, the task is to find the maximum area of the rectangle with that given perimeter.A rectangle is a type of parallelogram whose opposite sides are equal and parallel.The perimeter of a rectangle is the sum of all sides of a rectangle; we can also ... Read More

Advertisements