Count the number of co-prime pairs in an array

Program: Count the number of co-prime pairs in an array. (co-prime numbers means Any two numbers whose GCD is 1) Input: The first line contains an integer T, total number of elements. Then follow T elements. Output: Count the number of co-prime pairs in an array. Sample Input and Output: Input 1: 3 1 2 3 Output 1: 3 Here, Co-prime pairs are (1, 2), (2, 3), (1,...

Back to Top