Lcm in c language program #youtubeshorts #shorts write a program to find Lcm in c language #coding

preview_player
Показать описание
Lcm in c language program #youtubeshorts #shorts write a program to find Lcm in c language #coding#shorts
#youtubeshorts #programming #like #viral #foryou #youtubeshorts
Рекомендации по теме
Комментарии
Автор

Source code is available 👇

#include<stdio.h>
int main()
{
int n1, n2, lcm;
printf("Enter the two numbers:");
scanf("%d%d", &n1, &n2);
lcm=(n1>n2)? n1:n2; //n1 and n2 which is greater use ternary operator
while(1)
{
if(lcm%n1==0 && lcm%n2==0)
{
printf("LCM of %d and %d is = %d\n", n1, n2, lcm);
break;
}
++lcm;
}
return 0;
}

codewithmames
visit shbcf.ru