Loops/Increment loop index within loop body: Difference between revisions

→‎{{header|Common Lisp}}: Ups, typo with test function
(=={{header|Common Lisp}}== Added Common Lisp)
(→‎{{header|Common Lisp}}: Ups, typo with test function)
Line 1,117:
((= c 42)) ; Break condition when there are 42 primes
(incf i) ; Increments index by unity
(if (primep2primep i)(progn (incf c) ; If prime increment count of primes
(format t "~&~5<~d~;->~>~20<~:d~>" c i) ; Display count of primes found and the prime
(incf i (decf i))))) ; Increment index to previous index plus the prime
</lang>
{{out}}
15

edits