Find LCM of two number | C-program

LCM of two number

Code:

#include<stdio.h>

void main()

{

    int a,b,l;

    printf("Enter two number:\n");

    scanf("%d%d",&a,&b);

    for(l=1;l<=a*b;l++)

        {
            if(l%a==0 && l%b==0)

            break;
        }

        printf("\nLCM is %d",l);

    getch();

}

Output:

 

Comments

Popular posts from this blog

TOP 10 PROGRAMMING LANGAUAGES COMMING 2021 | ARTICLE

Write a C-program to swap two number:

Print Fibonacci Series using Recursion | C program :