C Program Sample Code
This blog contains C program sample code. One can use this free code.
Monday, May 23, 2016
How to find LCM of two numbers in C Language
Find LCM of two numbers in C Language
C Program for LCM of Two Numbers:
#include<stdio.h>
void main()
{
int x, y, LCM;
x = 4; y = 9; LCM =1;
for(;;)
{
if(LCM % x != 0 || LCM % y != 0)
++LCM;
else
break;
}
printf("LCM of x and y is = %d", LCM);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment