C Program to Find LCM of Two Numbers

Least Common Multiply:

LCM of two integers is a smallest positive integer which is multiple of both integers that it is divisible by the both of the numbers example: LCM of two numbers 9 and 6 is 18.

Program:

//C Program to find LCM of two numbers


#include<stdio.h> 
#include<conio.h> 
void main() 

int x,y,z,i; 
clrscr(); 
printf("Enter Two Numbers = "); 
scanf("d%d",&x,&y); 
for(i=1;i<=x*y*z;i++) 

if(i%x==0&&i%y==0) 

printf("LCM is %d\n",i); 
break; 


getch(); 
}
Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...
 
Posts RSSComments RSSBack to top
© 2013 Updated Tech News Results and Reviews