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

Hybrid View

  1. #1
    Join Date
    Aug 2013

    Exclamation Idiot/Noob HelpLine :) <----------HERE

    Hey guys im rather new to programming and I have a newbie question for you:

    I am making a program as a project, that's purpose is to tell whether a number is divisable by 1,2,3,4,5,6,7,8,9 and/or 10.
    So far I have the graphic parts done like JOptionPanes and SystemOuts but I am stuck on the Calculation Parts. I need the program to separate the digits in a potentially 200 digit long number and "read" them. Here is an Example of one of the Equations i need to do:

    To tell whether a number is divisable by 11 you must take the even number places (reading left to right: odd,even,odd,etc.), add them up, then add all the odd places, then take the sums, and subtract the evens from the odds.

    So... Fairly specifically... how would I do this? (Please include all var's and associated scanners: Remember Im new at this)


  2. #2
    Join Date
    Aug 2013

    Re: Idiot/Noob HelpLine :) <----------HERE

    All you have to do is to use modulo operator. If you don't know what modulo operator is, see wiki http://en.wikipedia.org/wiki/Modulo_operation or simple example here: http://www.cprogramming.com/tutorial/modulus.html.

  3. #3
    Join Date
    Aug 2013

    Re: Idiot/Noob HelpLine :) <----------HERE

    Hey Luke aor anybody else... If I could have a java example of the modulo operator that would be great! Thanks!
    Last edited by percy121; August 12th, 2013 at 12:39 PM.

Tags for this Thread

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.