New paste Repaste Download
#include <iostream>
using namespace std;
int gcd(int a, int b){
    if (b==0){
    return a;
}
return gcd (b,a%b);
}
int lcm (int a,int b) {
return (a*b)/gcd(a,b);
}
int main () {
    int a,b;
    cout << "Enter [a] : ";
    cin >> a;
    cout << "Enter [b] : ";
    cin >> b;
    int g = gcd(a, b);
    cout << "GCD  of a and b is: "<< g;
}
Filename: None. Size: 382b. View raw, , hex, or download this file.

This paste expires on 2026-03-02 03:07:37.118468+00:00. Pasted through web.