0

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 by Dani: Formatting fixed

3
Contributors
7
Replies
10
Views
5 Years
Discussion Span
Last Post by pyTony
0
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. 
0

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. )

0

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

0

Post the algorithm you found and your questions about it.

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

Edited by NormR1

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.