No products in the cart.

Java code to find LCM of …

CBSE, JEE, NEET, CUET

CBSE, JEE, NEET, CUET

Question Bank, Mock Tests, Exam Papers

NCERT Solutions, Sample Papers, Notes, Videos

Java code to find LCM of two numbers.
  • 6 answers

Divya Sen 6 years, 10 months ago

And thnk u too vineet.

Divya Sen 6 years, 10 months ago

Yeah thnx my pen frnd bhumi

Vineit Kumar Gupta 6 years, 10 months ago

(Even though i dont know java much and c++ is my major ) public class LCM { public static void main(String[] args) { int n1 = 72, n2 = 120, lcm; // maximum number between n1 and n2 is stored in lcm lcm = (n1 > n2) ? n1 : n2; // Always true while(true) { if( lcm % n1 == 0 && lcm % n2 == 0 ) { System.out.printf("The LCM of %d and %d is %d.", n1, n2, lcm); break; } ++lcm; } } }

Bhumi Jain 6 years, 10 months ago

Is it helpful to you my pen frnd,Divya

Bhumi Jain 6 years, 10 months ago

Int a=Integer.parseint (jTF1.getText()); Int b= While (a!=b) { if (a>b) a=a-b; else b=a-b; JOP.SMD (null,a*b/a);

Divya Sen 6 years, 10 months ago

Bhumi if u have the ans plzz give i really need it.
http://mycbseguide.com/examin8/

Related Questions

Founder of python
  • 2 answers

myCBSEguide App

myCBSEguide

Trusted by 1 Crore+ Students

Test Generator

Test Generator

Create papers online. It's FREE.

CUET Mock Tests

CUET Mock Tests

75,000+ questions to practice only on myCBSEguide app

Download myCBSEguide App