APC-PRAC-020.c (877B)
1 /* 2 * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 3 * Repo: https://github.com/notamitgamer/bsc 4 * License: MIT 5 */ 6 7 /* Write a program to check if two number is co-prime or not */ 8 // File Name - amit0711202502.c (LAB), APC-PRAC-020.c (Local) 9 10 // This code has not been compiled. 11 // If you find any issues, please create a new issue on GitHub regarding them. 12 // Go to this link to create a new issue: https://github.com/notamitgamer/bsc/issues 13 14 #include <stdio.h> 15 16 int main() 17 { 18 int a, b, temp, temp_a, temp_b; 19 printf("Enter the a and b : "); 20 scanf("%d %d", &a, &b); 21 temp_a = a, temp_b = b; 22 while (b > 0) 23 { 24 temp = a; 25 a = b; 26 b = temp % b; 27 } 28 if (a == 1) 29 printf("\n%d and %d is co-prime\n", temp_a, temp_b); 30 else 31 printf("\n%d and %d is NOT co-prime\n", temp_a, temp_b); 32 return 0; 33 }