QB64 Phoenix Edition
Calculation of New Year - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Holiday Code (https://qb64phoenix.com/forum/forumdisplay.php?fid=48)
+---- Thread: Calculation of New Year (/showthread.php?tid=4283)



Calculation of New Year - eoredson - 01-01-2026

Code: (Select All)
Rem program to determine New Year factors.
z = 2025
Do Until z = 2026
   z = z + 1
   x = z
   Print x; "=";
   l = 1
   q = 0
   Do Until x = 1
      l = l + 1
      Do While x / l = x \ l ' continue to divide number
         q = q + 1
         If q > 1 Then
            Print "*";
         End If
         Print l;
         x = x / l
      Loop
      If l > Int(z / 2) Then ' test for maximum divisor
         Exit Do
      End If
      If l > Int(Sqr(x)) Then ' test maximum divisor is prime
         If q = 0 Then
            Exit Do
         End If
      End If
   Loop
   If q = 0 Then ' display number is prime
      Print " (prime)";
   End If
   y = 0
   If z / 4 = z \ 4 Then y = -1
   If z / 100 = z \ 100 Then y = 0
   If z / 400 = z \ 400 Then y = -1
   If y Then Print " [is a leapyear]";
   If y = 0 Then Print " [is not a leapyear]";
   Print
Loop
End



RE: Calculation of New Year - bplus - 01-01-2026

Right! nothing to calculate we're there! Happy New Year all!


RE: Calculation of New Year - eoredson - 01-01-2026

(01-01-2026, 01:33 PM)bplus Wrote: Right! nothing to calculate we're there! Happy New Year all!
I renamed the topic and it deleted the contents.