File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed
GreatestCommonDivisor/C++ Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 1+ #include < iostream>
2+ using namespace std ;
3+ // Recursive Function to calculate GCD
4+ int gcd (int a,int b)
5+ {
6+ if (b==0 )
7+ return a;
8+ else
9+ return gcd (b,(a%b));
10+ }
11+ // Driver program
12+ int main ()
13+ {
14+ int a,b;
15+ cout << " Enter the two numbers to calculate gcd" << endl;
16+ cin >> a >>b;
17+ cout <<" Gcd of " << a << " " << b << " is " << gcd (a,b)<< endl;
18+ return 0 ;
19+ }
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ Fast Fourier Transform | | | | | :+1: | | | |
2525Fibonacci | :+1 : | :+1 : | | :+1 : | | | :+1 : | | :+1 :
2626FisherYatesShuffle | :+1 : | | | | :+1 : | :+1 : | | :+1 : |
2727Floyd'sAlgorithm | :+1 : | :+1 : | | | :+1 : | | | |
28- GreatestCommonDivisor | :+1 : | | :+1 : | :+1 : | | | | |
28+ GreatestCommonDivisor | :+1 : | | :+1 : | :+1 : | : +1 : | | | |
2929HammingDistance | :+1 : | :+1 : | | | | :+1 : | | |
3030HeapSort | :+1 : | :+1 : | | | :+1 : | :+1 : | :+1 : | | :+1 :
3131HistogramEqualization | :+1 : | | | | | | | |
You can’t perform that action at this time.
0 commit comments