/*C Program to Find LCM and GCD*/

#include<stdio.h>

#include<conio.h>

void main()

{

int n1,n2,a,b;

printf(“\nEnter Two Numbers: “); 

scanf(“%d %d”,&n1,&n2);

a=n1;b=n2;

while(n1!=n2)

{

    if(n1>n2)

                      n1=n1-n2;

    else

                     n2=n2-n1;

}

printf(“\nLCM= %d”,(a*b)/n1); 

printf(“\nGCD= %d”,n1); 

getch();

}

150,292 total views, 374 views today

Get Free Email Updates..!
Join us for FREE to get instant email updates..! GobsInfo- Everything Unlimited
We hate spam. Your email address will not be sold or shared with anyone else.

10,042 Thoughts to “C Program to Find LCM and GCD”

  1. Thank you for the good writeup. It in fact was a amusement account
    it. Look advanced to more added agreeable from you!
    By the way, how can we communicate? Minecraft free to play 2018

Leave a Comment