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 firstname.lastname@example.org. 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.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Composite XOR and Coprime AND
- Largest Coprime Set Between two integers
- Coprime divisors of a number
- Largest number less than or equal to N/2 which is coprime to N
- Print all distinct Coprime sets possible from 1 to N
- Count of integers up to N which are non divisors and non coprime with N
- Print all Coprime path of a Binary Tree
- Count all pairs of divisors of a number N whose sum is coprime with N
- Finding a Non Transitive Coprime Triplet in a Range
- Check if a given pair of Numbers are Betrothed numbers or not
- Find the length of the Largest subset such that all elements are Pairwise Coprime
- Length of the longest increasing subsequence such that no two adjacent elements are coprime
- Check whether XOR of all numbers in a given range is even or odd
- Check if sum of divisors of two numbers are same
- Check whether product of 'n' numbers is even or odd
- Check if an Array is a permutation of numbers from 1 to N : Set 2
- Check the divisibility of Hexadecimal numbers
- Check if the given two numbers are friendly pair or not
- Check whether two numbers are in golden ratio
- Check whether the given numbers are Cousin prime or not
Improved By : jit_t