(02-08-2023, 05:31 AM)PhilOfPerth Wrote: An interesting program!
I wish I knew how it works though - it's quite cryptic to me!
Any chance of naming some variables, to enlighten dummies like me?
And do the labels "80" and "0" have a purpose?
For @PhilOfPerth
Code: (Select All)
'yearInteger/testInteger = yearInteger\testInteger is one way to see if yearInteger is divided by testInteger
' / is for float return a number that might have decimals
' \ is for an Integer return a number without decimals
' When the two divisions return exactly same number the bottom number divides the top exactly.
Dim As Long testInteger, yearInteger
yearInteger = 2023
For testInteger = 2 To Sqr(yearInteger) ' <<< primes of a Number will be less than or = to Square Root of Number
If yearInteger / testInteger = yearInteger \ testInteger Then Print testInteger; "divides"; yearInteger; yearInteger / testInteger; "times."
Next
b = b + ...