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

Function gcd

Basic Programming/euclid_gcd.cpp:4–9  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2using namespace std;
3
4int gcd (int a, int b) {
5 if (b == 0)
6 return a;
7 else
8 return gcd (b, a % b);
9}
10int main(void){
11 int a,b; cin >> a >> b;
12 cout << gcd(a,b);

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected