Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Calculate H.C.F using recursion
//clang 3.8.0 #include <iostream> using namespace std; int hcf(int n1, int n2); int main() { int n1, n2; cout << "Enter two positive integers: "; cin >> n1 >> n2; cout << "H.C.F of " << n1 << " & " << n2 << " is: " << hcf(n1, n2); return 0; } int hcf(int n1, int n2) { if (n2 != 0) return hcf(n2, n1 % n2); else return n1; }
run
|
edit
|
history
|
help
0
Dynamic call
MPL 2-0
range based for loop temporary object lifetime issue example
overloading
Copy uint64 data into uint32 with padding
HexDong
Recursive Call Example Sum
<string> No indirect include of <errno.h>
Program_3
Template arguments may contain calls to constexpr functions.