C Language
#include<stdio.h> #include<conio.h> void main( ) { int n1, n2, a = 1, H; clrscr( ); printf("Enter Two Numbers = "); scanf('%d%d',&n1, &n2); if(n1 > n2) { a = n1%n2; n1 = n2; n2 = a; } while (a > 0); H = n1; } else { do { a = n2%n1; n2 = n1; n1 = a; } H = n2; } printf("HCF = %d",H); getch( ); }