#include <iostream>
// Function prototype
int calculateGCD(int num1, int num2);
int main() {
// Input two numbers from the user
int number1, number2;
std::cout << "Enter first number: ";
std::cin >> number1;
std::cout << "Enter second number: ";
std::cin >> number2;
// Call the function to calculate the GCD
int gcd = calculateGCD(number1, number2);
// Display the GCD
std::cout << "GCD of " << number1 << " and " << number2 << " is: " << gcd;
return 0;
}
// Function to calculate the GCD using Euclidean algorithm
int calculateGCD(int num1, int num2) {
while (num2 != 0) {
int temp = num2;
num2 = num1 % num2;
num1 = temp;
}
return num1;
}