int max = a>b?a:b; // set max to the larger of a and b
Chat with our AI personalities
By first GIVING the numbers!
When you are given some numbers just arrange them in ascending order and you will the smallest number which can be made out of those given numbers.
if the gcd and lcm are given and one of the numbers are also given,multiply the gcd and lcm and divide them by the given number
To find twin primes of a given number, iterate through the numbers starting from the given number, and for each number, check if both the number and the number+2 are prime. If they are, then they form a pair of twin primes with the given number.
3 and 6