Two numbers A and B are said to be Co-Prime or mutually prime if the Greatest Common Divisor of them is 1. You have been given two numbers A and B, find if they are Co-prime or not.
Input : 2 3 Output : Co-Prime Input : 4 8 Output : Not Co-Prime
Co-Prime Not Co-Prime
This article is contributed by Dibyendu Roy Chaudhuri. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Composite XOR and Coprime AND
- Largest number less than or equal to N/2 which is coprime to N
- Finding a Non Transitive Coprime Triplet in a Range
- Length of the longest increasing subsequence such that no two adjacent elements are coprime
- Check if sum of divisors of two numbers are same
- Check whether XOR of all numbers in a given range is even or odd
- Check whether product of 'n' numbers is even or odd
- Check the divisibility of Hexadecimal numbers
- Check whether the given numbers are Cousin prime or not
- Check if the given two numbers are friendly pair or not
- Check if two numbers have same number of digits
- Check whether given three numbers are adjacent primes
- Check if all sub-numbers have distinct Digit product
- Check if product of first N natural numbers is divisible by their sum
- Check if a number can be expressed as sum two abundant numbers
Improved By : jit_t