java program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hdevi
    New Member
    • Jun 2007
    • 1

    #1

    java program

    please tell me how to write a java program to find factors of given number
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by hdevi
    please tell me how to write a java program to find factors of given number
    Do you know what the '%' (modulo) operator does? Its result is the remainder
    r of its operands n and d such that n= (n/d)*d+r, e.g. 7%3 == 1 and 12%5 == 2.
    You'll need that operator if you want to find divisors d of a number n because
    n%d will be equal to zero then.

    kind regards,

    Jos

    Comment

    • jeffbroodwar
      New Member
      • Oct 2006
      • 118

      #3
      Hi,

      Please write a sample code / snippet that will show this program. From that code we might be able to help... ok? try the modulus operator that jos told you.

      Best Regards,
      Jeff

      Comment

      Working...