Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  zishan
Language: C/C++
Code:
#include<stdio.h>
#includ<conio.h>
void main()
{
int m,n,p,q,gcd,lcm,rem;
printf("enter two numbers:");
scanf("%d%d",&m,&n);
p=m;
q=n;
while(n!=0)
{
rem=m%n;
m=n;
n=rem;
}
gcd=m;
lcm=(p*q)/gcd;
printf("/n the gcd=%d",gcd);
printf("/n the lcm=%d",lcm);
}
          
          
          
Comments: