Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<conio.h>
- void main (void)
- {
- int l,k,q,r,temp;
- printf("Enter two numbers:");
- scanf("%d %d",&l,&k);
- if(k>l)
- {
- temp=1;
- l=k;
- k=temp;
- }
- while (k!=0)
- {
- q=l/k;
- r=l%k;
- if(r!=0)
- {
- l=k;
- k=r;
- }
- else
- {
- printf("HCF=%d",k);
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement