COMP2113
COMP2113_ENGG1340 Programming technologies and Computer programming II [Section 2BC] [2023]
Loading...
Searching...
No Matches
gcd.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int gcd (int a, int b)
 

Function Documentation

◆ gcd()

int gcd ( int a,
int b )

Definition at line 157 of file 1.cpp.

157 {
158 while(a != b){
159 if (a>b){
160 a -= b;
161 }
162 else if (a<b){
163 b -= a;
164 }
165 else{
166 break;
167 }
168 }
169 return a;
170}

Referenced by decryption(), lcm(), and main().

Here is the caller graph for this function: