
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Arnab Chakraborty has Published 4293 Articles
Find the number of integers x in range (1,N) for which x and x+1 have same number of divisors in C++

Arnab Chakraborty
159 Views
Suppose, we have an integer N, we have to find the number of integers 1 < x < N, for which x and x + 1 has same number of positive divisors. So if N = 3, then output will be 1, as divisor of 1 is 1, divisor of ... Read More

Arnab Chakraborty
249 Views
Suppose, we have two integers x and n, our task is to search for the first consecutive stream of 1s (32-bit binary) which is greater than or equal to the value of n in length and return its position. If no such string exists, then return -1. For example, if ... Read More

Arnab Chakraborty
193 Views
Suppose, we have a number n. Our task is to find the number of integers from 1 to n, which contains digits 0s and 1s only. So if n = 15, then output will be. As the numbers are 1, 10, 11To solve this, we will create integers using 0s ... Read More

Arnab Chakraborty
715 Views
Suppose we have three arrays with some elements. We have to find all the common elements that are present in these three arrays. Suppose these elements are [10, 12, 15, 20, 25], [10, 12, 13, 15] and [10, 12, 15, 24, 25, 26], then the common elements in these three ... Read More

Arnab Chakraborty
377 Views
Suppose, we have an integer N, We have to find the number of all possible distinct binary strings of the length N, which have at least three consecutive 1s. So if n = 4, then the numbers will be 0111, 1110, 1111, so output will be 3.To solve this, we ... Read More

Arnab Chakraborty
228 Views
Suppose we have three linked lists. We have to find all the common elements that are present in these three linked lists. Suppose these lists are [10, 12, 15, 20, 25], [10, 12, 13, 15] and [10, 12, 15, 24, 25, 26], then the common elements in these three lists ... Read More

Arnab Chakraborty
2K+ Views
Suppose we have two integers n and m. We have to find the number closest to n and divide by m. If there are more than one such number, then show the number which has maximum absolute value. If n is completely divisible by m, then return n. So if ... Read More

Arnab Chakraborty
196 Views
Here we will see how to find the closest value for every element in an array. If an element x has the next element that is larger than it, and also present in the array, then that will be the greater value of that element. If the element is not ... Read More

Arnab Chakraborty
105 Views
Suppose we have two integers P and Q. We have to find smallest number K, such that K mod P = 0 and Q mod K = 0. Otherwise print -1. So if the P and Q are 2 and 8, then K will be 2. As 2 mod 2 ... Read More

Arnab Chakraborty
275 Views
Consider we have the selling price, and percentage of profit or loss is given. We have to find the cost price of the product. The formula is like below −$$Cost Price=\frac{Sell Price∗100}{100+percentage profit}$$ $$Cost Price=\frac{Sell Price∗100}{100+percentage loss}$$Example Live Demo#include using namespace std; float priceWhenProfit(int sellPrice, int profit) { return (sellPrice ... Read More