Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
C++ code to get two numbers in range x with given rules
Suppose we have a number x. We have to find two integers a and b, such that both of them will be in between 1 and x, a is divisible by b, a * b > x but a/b
To solve this, we will follow these steps −
if xExample
Let us see the following implementation to get better understanding −
#includeusing namespace std; void solve(int x){ if (x Input
10Output
10,10
Advertisements
