-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgcdDriver.cpp
More file actions
34 lines (25 loc) · 724 Bytes
/
Copy pathgcdDriver.cpp
File metadata and controls
34 lines (25 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//=====================================================
//gcdDriver.cpp
//Test code for a greatest common divisor function
//=====================================================
#include <iostream>
using namespace std;
//External routine declarations
int gcd(int,int);//declare the gcd function
//=================>> main <<==========================
int main()
{
cout<<"gcd(4, 2) = ";
cout<<gcd(4, 2)<<endl;
cout<<"gcd(2, 4) = ";
cout<<gcd(2, 4)<<endl;
cout<<"gcd(259, 111) = ";
cout<<gcd(259, 111)<<endl;
cout<<"gcd(1375, 218491) = ";
cout<<gcd(1375, 218491)<<endl;
cout<<"gcd(541, 3804853) = ";
cout<<gcd(541, 3804853)<<endl;
cout<<"gcd(0, 56) = ";
cout<<gcd(56, 0)<<endl;
return 0;
}