Problem: Two integers a and b are said to be relatively prime or co-prime if the only positive integer that evenly divides both of them is 1. That is, the only common positive factor of the two numbers is 1. This is equivalent to their greatest common divisor being 1.
int gcd(int a,int b)
Source: programmaniaa blog.
*To get the more, view the [TCS] Finding co-prime numbers (CodeVita) Problem [Solved]. These are only for reference purpose.