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
![]() |
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
In your loop add a counter that you increment esh time the divisible by 3 condition is met.
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 06:52 PM. |