MCPcopy Create free account
hub / github.com/anupam-kumar-krishnan/Competitive_Programming / hcf

Function hcf

Basic Programming/HCFofTwoNum.cpp:4–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2using namespace std;
3
4int hcf(int num1, int num2){
5 if(num1 == 0)
6 return num2;
7
8 if(num2 == 0)
9 return num1;
10
11 if(num1 == num2)
12 return num1;
13
14 if(num1 > num2)
15 return hcf(num1-num2, num2);
16
17 return hcf(num1, num2-num1);
18}
19
20int main(){
21 int num1,num2;

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected