CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    How to find out that the remainder of two number is 1.

    I want to test in a loop any time I have a number dividing another one ,
    could you please tell how
    Thanks


  2. #2
    Join Date
    Aug 1999
    Location
    San Diego
    Posts
    155

    Re: How to find out that the remainder of two number is 1.

    Use should use modulus (ie '%')

    For example: x%y = remainder of x/y
    so 4%2 = 0
    5%3 = 2

    Dustin


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured