MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

CPP/questions/gcd_hcf.cpp:15–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15int main(){
16 cin.tie(0)->sync_with_stdio(0);
17 int a,b;
18 cin>>a>>b;
19 int ans;
20 for (int i =1; i<=min(a,b); ++i)
21 {
22 if(a%i==0 && b%i==0)
23 ans=i;
24 }
25 cout<<"using brute force gcd : "<<ans<<endl;
26 cout<<"gcd of nums are : "<<gcdeuclid(a,b);
27
28 return 0;
29}

Callers

nothing calls this directly

Calls 1

gcdeuclidFunction · 0.85

Tested by

no test coverage detected