nausheen Active member
| Subject: solve the computer program Tue Feb 05, 2008 6:31 pm | |
| write a program in java to enter 2 numbers and find the H.C.F and L.C.M and display the result. |
|
abhas Active member
| Subject: ICSE Java Tue Feb 05, 2008 7:41 pm | |
| // icse java hcf lcm program using bluej ide
class hcfLcm { void main(int a,int b) {
int h=1; for(int c=2;c<=a;c++) { if(a%c==0 && b%c==0) h=c; } int l=(a*b)/h;
System.out.println("HCF:"+h); System.out.println("LCM:"+l); } } |
|
debangana
| Subject: Re: solve the computer program Fri Jul 09, 2010 9:21 pm | |
| plzz tell me a site where good programs can be found for icse practice |
|
Sponsored content
| Subject: Re: solve the computer program | |
| |
|