Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Visual Basic (https://www.askmehelpdesk.com/forumdisplay.php?f=469)
-   -   Loops and specific numbers (https://www.askmehelpdesk.com/showthread.php?t=418194)

  • Nov 21, 2009, 08:23 PM
    radclifa
    Loops and specific numbers
    I need to count up the numbers of numbers divisible by 3 in a program. I know how to figure out which numbers are divisible by 3, but not how to get the program to give me a number for the numbers that fit that distinction
  • Nov 21, 2009, 08:26 PM
    ScottGem

    In your loop add a counter that you increment esh time the divisible by 3 condition is met.
  • Nov 25, 2009, 11:09 AM
    slapshot_oi

    Use a for-loop and pass your increment variable to a GCD function.

    Also, you should use the Euclidean GCD algorithm.

  • All times are GMT -7. The time now is 08:55 PM.