{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

GCF Program - cout<<"Value 1" cin>> x...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #include <iostream> using namespace std int GCD(int a, int b) { while( 1 ) { a = a % b if( a == 0 ) return b b = b % a if( b == 0 ) return a } } int main() { int x, y cout << "This program allows calculating the GCD\n"
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cout << "Value 1: " cin >> x cout << "Value 2: " cin >> y cout << "\nThe Greatest Common Divisor of " << x << " and " << y << " is " << GCD(x, y) << endl return 0 }...
View Full Document

{[ snackBarMessage ]}