#include<stdio.h> int main(){ int x,y,m,i; printf("Insert any two number: "); scanf("%d%d",&x,&y); if(x>y) m=y; else m=x; for(i=m;i>=1;i--){ if(x%i==0&&y%i==0){ printf("\nHCF of two number is : %d",i) ; break; } } return 0; }
Filled Under
C
Write a c program for finding gcd (greatest common divisor) of two given numbers
Related:

C code for fractional binary to decimal converter

C code for product of two binary numbers

C code for sum of two binary numbers:

How to convert large binary number to hexadecimal

C code for binary to decimal conversion

C code for how to convert large binary to octal

C program to convert binary to octal

C program for hexadecimal to binary conversion
Subscribe to:
Post Comments (Atom)