APC-PRAC-019.c (638B)
1 /* Write a program to find hcf of two numbers */ 2 // File Name - amit0711202501.c (LAB), APC-PRAC-019.c (Local) 3 4 // This code has not been compiled. 5 // If you find any issues, please create a new issue on GitHub regarding them. 6 // Go to this link to create a new issue: https://github.com/notamitgamer/bsc/issues 7 8 #include <stdio.h> 9 10 int main() 11 { 12 int a, b, temp, temp_a, temp_b; 13 printf("Enter the a and b : "); 14 scanf("%d %d", &a, &b); 15 temp_a = a, temp_b = b; 16 while (b > 0) 17 { 18 temp = a; 19 a = b; 20 b = temp % b; 21 } 22 printf("\nHCF of %d and %d is : %d\n", temp_a, temp_b, a); 23 return 0; 24 }