C++ program calculate gcd and lcm of 3 integer numbers using recursion
Answers
Answered by
0
Answer:
C program for no.Of days remaining in a year for the given date and month of a year
Answered by
0
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;
}
Similar questions
Chemistry,
6 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
Biology,
1 year ago