can anybody explain with details how to calculate the factor of a number ? i m trying to do this with while statement. how can i do this ? please...

Edited 1 Year Ago by Dani: Formatting fixed

public void determineFactor(int sayi){
        int number = 1;
        int sayi1 = 1; 
        while (number <= sayi){ 
            number++;
            number = number * sayi1;  

        }//end while
    System.out.println(number); 
    }
}//end class


   ///and the value of sayi is defined as 5 in the driver class. 

can anybody explain with details how to calculate the factor of a number ? i m trying to do this with while statement. how can i do this ? please... ( i have already written this above. )

i googled this, but i could not understand the logic of it. can you please explain it to me emphasizing its logic.

Post the algorithm you found and your questions about it.

Factors for 12: 1,2,3,4,6

Edited 4 Years Ago by NormR1

This question has already been answered. Start a new discussion instead.