P040.c (306B)
1 /* Write a program to calculate HCF of two positive number */ 2 3 #include <stdio.h> 4 int main() 5 { 6 int a, b, temp; 7 printf("Enter two number : "); 8 scanf("%d %d", &a, &b); 9 while (b > 0) 10 { 11 temp = a; 12 a = b; 13 b = temp % b; 14 } 15 printf("HCF = %d", a); 16 return 0; 17 }