C Program to find LCM

#include <stdio.h>

#include<conio.h>

void main() 

{

    int n1, n2, m;

    clrscr();

    printf("Enter two Numbers\n ");

    scanf("%d %d", &n1, &n2);

    m = (n1 > n2) ? n1 : n2;

    while (1) 

    {

            if (m % n1 == 0 && m % n2 == 0) {

            printf("The LCM of %d and %d is %d", n1, n2, m);

            break;

        }

        ++m;

    }

    getch();

}


Output


Enter two Numbers

52

78


The LCM of 52 and 78 is 156