AD 1

Posted by : Unknown Thursday, November 20, 2014

Program Sorce Code:-

Type this code in your compiler. Then Compile and Run. I have used Dev C++.

#include <stdio.h>
void main()
{
  int num1, num2, max;
  printf("Enter two positive integers: ");
  scanf("%d %d", &num1, &num2);
  max=(num1>num2)?num1:num2;
  while(1)                      
  {
      if(max%num1==0 && max%num2==0)
      {
          printf("\nLCM of %d and %d is %d", num1, num2,max);
          break;          
      }
      ++max;
  }
  getch();
}

INPUT:-


OUTPUT:-



Leave a Reply

Subscribe to Posts | Subscribe to Comments




Total Pageviews

Popular Post

Source

Powered by Blogger.

About Us

- Copyright © Music Technology & Sports Junction -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -