Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Welcome to 2023.
#5
(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 + ...
Reply


Messages In This Thread
Welcome to 2023. - by eoredson - 02-08-2023, 03:39 AM
RE: Welcome to 2023. - by PhilOfPerth - 02-08-2023, 05:31 AM
RE: Welcome to 2023. - by bplus - 02-08-2023, 03:32 PM
RE: Welcome to 2023. - by eoredson - 02-08-2023, 05:40 AM
RE: Welcome to 2023. - by PhilOfPerth - 02-08-2023, 09:03 AM
RE: Welcome to 2023. - by PhilOfPerth - 02-08-2023, 11:09 PM



Users browsing this thread: 1 Guest(s)