Sunidhi Bansal has Published 1085 Articles

Count and Sum of composite elements in an array in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 09:11:42

433 Views

We are given with an array of positive integers and the task is to calculate the count and sum of the composite elements in the given array.What are composite numbersFrom the given set of integers, the numbers that are not prime are called composite numbers except 1 which is neither ... Read More

Count all the numbers less than 10^6 whose minimum prime factor is N C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 09:08:22

215 Views

We are given a prime number let’s say, num and the task is to calculate the count of all the numbers less than 10^6 whose minimum prime factor is equal to num.For ExampleInput − num = 7 Output − Number of prime factors = 38095 Input − num = ... Read More

Count common prime factors of two numbers in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 09:04:26

353 Views

We are given the two numbers let’s say x and y and the task is to find the common prime factors between two numbers. Common prime factors can be found by firstly calculating the common numbers between two numbers and after that checking from the list of common factors the ... Read More

Count Fibonacci numbers in given range in O(Log n) time and O(1) space in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 09:00:55

606 Views

We are given the range having start and end numbers and the task is to calculate the total count of Fibonacci numbers available between the given range in O(Log n) time and O(1) space.What are Fibonacci numbersFibonacci numbers are the sequence of numbers known as Fibonacci sequence where every new ... Read More

Count digits in a factorial in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 08:51:41

2K+ Views

We are given an integer value and the task is to first calculate the factorial of a number and then calculate the total number of digits in a result.What is a factorial numberFactorial of a number is calculated by multiplying the digits in a number while decrementing the value of ... Read More

Count factorial numbers in a given range in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 08:49:16

359 Views

We are given the range starting from an integer value holded by a variable let’s say start till the variable end and the task is to count the total number of factorial numbers available in the given range.What is a factorial numberFactorial of a number is calculated by multiplying the ... Read More

Count even and odd digits in an Integer in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 08:45:56

3K+ Views

We are given with an integer number and the task is to count the even numbers and the odd numbers in a digit. Also, we will keep check on whether the even digits in an integer are occurring an even number of times and also the odd digits in an ... Read More

Count common characters in two strings in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 08:41:27

2K+ Views

We are given with the two strings let’s say str1 and str2 and the task is to find the count of common characters in two strings i.e. if str1[i] = str[j], then they will be considered as a pair and count will increased to 1 and if str1[i]!=str2[j] then they ... Read More

Convert characters of a string to opposite case in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 08:30:17

583 Views

We are given a string of any length and the task is to convert the string having uppercase letters to lowercase letters and lowercase letters to uppercase letters.For ExampleInput − string str = ”Welcome To The Site!”Output − wELCOME tO tHE sITE!Explanation − converted the letters W, T, T, S to lowercase and ... Read More

Convert distance from km to meters and centimeters in PL/SQL

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 08:27:43

644 Views

The task is to convert the distance from kilometers to meters and centimeters in PL/SQL.PL/SQL is the extension of SQL which combines the Data manipulation of SQL with the working of procedural language.According to the problem we should have distance in kilometers whose value we have to convert in meters ... Read More

Advertisements