Header Ads

Hii,I am Anand Nayak.This blogger is make for specially basic programs of some language.

LCM

#include<stdio.h>
#include<conio.h>
  void main()
  {
  int a,lcm;
  clrscr();
  printf("enter any number which you want lcm");
  scanf("%d",&a);
  for(a=1;a>b?a:b;lcm++)
 if(lcm%a==0 && lcm%b==0)
 printf("%d",lcm);
  getch();
  }

No comments