Skip to content

Commit 9ac10a7

Browse files
committed
find the hcf of a number c-basics
1 parent 7c769ae commit 9ac10a7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

hcf.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include<stdio.h>
2+
#include<math.h>
3+
void main()
4+
{
5+
int a,b,n;
6+
printf("Enter the number1");
7+
scanf("%d",&a);
8+
printf("Enter the number2");
9+
scanf("%d",&b);
10+
while(n!=0)
11+
{
12+
n=a-b;
13+
n=abs(n);
14+
b=a;
15+
a=n;
16+
}
17+
printf("%d",b);
18+
}

0 commit comments

Comments
 (0)