#include <stdio.h>
int main() 
{
    int a,b,c,d,e;
    scanf("%d",&a);
    printf("the value of a is %d",a);
    scanf("%d",&b);
    printf("the values of b is %d",b);
    c=a%b;
    d=b%c;
    e=c%d;
    if (a%b==0)
    {
    printf("the hcf of two numbers is %d",b);	
	}
	else if(b%c==0)
	{
		printf("the hcf of two numbers is %d",c);
	}
	else if(d==0) 
	{
		printf("the hcf of two numbers is %d",d);
	}
	else 
	{
		printf("the hcf of two numbers is %d",e);
	}
	return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: