Finding GCD and LCM of Given Numbers using C

 Finding GCD and LCM


int main()
    int no1, no2, rem=0, n1,n2;
    printf(“Enter Two Non-Zero Integer Mumbers:”);
    while(rem != 0)
    printf(“\n GCD of %d and %d is %d”, n1,n2,no2);
    printf(“\n LCM of %d and %d is %d”,n1,n2,(n1*n2)/no2);
    return 0;


Enter Two Non-Zero Integer Mumbers:15 25
GCD of 15 and 25 is 5
LCM of 15 and 25 is 75

Leave a Reply

Your email address will not be published.