65816-llvm-mos/compare/sumSquares.c
Scott Duensing e65fedc8e1 Checkpoint
2026-05-13 15:48:34 -05:00

8 lines
237 B
C

// Simple function for compiler-quality comparison.
unsigned long sumSquares(unsigned short n) {
unsigned long total = 0;
for (unsigned short i = 1; i <= n; i++) {
total += (unsigned long)i * i;
}
return total;
}