Professional Documents
Culture Documents
1. Aim/Overview of the practical: Code and Analyze to compute the greatest common divisor
(GCD) of two numbers
#include <iostream>
using namespace std;
if (a == b)
return a;
if (a > b)
return gcd(a-b, b);
return gcd(a, b-a);
}
int main()
{
int a = 92, b = 86;
cout<<"GCD of "<<a<<" and "<<b<<" is "<<gcd(a, b);
return 0;
}
6. Result/Output/Writing Summary:
Learning outcomes (What I have learnt):