#include <stdio.h>inthcf(inta,intb)// Euclid Algorithm. Notice it will work even if a < b{if(a%b==0)returnb;elsereturnhcf(b,a%b);}intmain(void){printf("Enter two numbers: ");inta,b;scanf("%d %d",&a,&b);// To accept the two numbers.printf("The hcf is: %d",hcf(a,b));// To print the result}

@Aamir Faisal Ansari , Sir your friend, Aditya Raut, recommends you to me. He said that you can help me. He said also that you are good in C Programming. :D . PLease Help.

Easy Math Editor

`*italics*`

or`_italics_`

italics`**bold**`

or`__bold__`

boldNote: you must add a full line of space before and after lists for them to show up correctlyparagraph 1

paragraph 2

`[example link](https://brilliant.org)`

`> This is a quote`

Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.`2 \times 3`

`2^{34}`

`a_{i-1}`

`\frac{2}{3}`

`\sqrt{2}`

`\sum_{i=1}^3`

`\sin \theta`

`\boxed{123}`

## Comments

Sort by:

TopNewestHere's the code to find HCF in C.

Log in to reply

Thank you very much sir. It helps me a lot.

Log in to reply

Don't know the syntax of C, but I'm guessing you can use Euclid's algorithm.

Log in to reply

Thanks Sir.

Log in to reply

@Aamir Faisal Ansari , Sir your friend, Aditya Raut, recommends you to me. He said that you can help me. He said also that you are good in C Programming. :D . PLease Help.

Log in to reply

@Aamir Faisal Ansari

Log in to reply