Ask Experts Questions for FREE Help !
Ask
    radclifa's Avatar
    radclifa Posts: 1, Reputation: 1
    New Member
     
    #1

    Nov 21, 2009, 08:23 PM
    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
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #2

    Nov 21, 2009, 08:26 PM

    In your loop add a counter that you increment esh time the divisible by 3 condition is met.
    slapshot_oi's Avatar
    slapshot_oi Posts: 1,537, Reputation: 589
    Ultra Member
     
    #3

    Nov 25, 2009, 11:09 AM

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

    Also, you should use the Euclidean GCD algorithm.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Rounding numbers to specific criteria [ 3 Answers ]

Hi, I am working on spreadsheets with values that I want to be able to round up based on this criteria: If the number ends in 0,1,2, then round to nearest 0 If the number ends in 3,4,5, then round to nearest 5 If the number ends in 6,7,8,9 then round to nearest 9 The spreadsheet contains...

Components of loops [ 1 Answers ]

What Component Is Present In Every Part Of A Loop, Such As One That Involves Proteins Producing Energetic Molecules From Sugar ?

Loops [ 2 Answers ]

What component is present in every part of a loop?


View more questions Search