Run Code
|
Code Wall
|
Users
|
Misc
|
Feedback
|
About
|
Login
|
Theme
|
Privacy
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
Please
log in
to post a comment.
Tilted uniform distribution random number generator over min/max range
C++ standard
overloadresolution
general
Virtual Function Example
Throttle Example in C++ (80 requests every 2 seconds)
Program_3
MPL 2-0
template specialization inheritance problem
Test size_t
Please log in to post a comment.