Integer sequence
Create a program that, when run, would display all integers from 1 to ∞ (or any relevant implementation limit) if given enough time.
Integer sequence is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.
BASIC
<lang basic>5 LET A = 0 10 LET A = A + 1 20 PRINT A 30 GOTO 10</lang>
C
<lang c>#include <stdio.h>
int main() {
uint_32 i = 0; while(1) { printf("%u\n", ++i); }
return 0;
}</lang>
Alternatively: <lang c>#include <stdio.h>
int main() {
for(uint i = 1; 1; i++) printf("%d\n", i);
return 0;
}</lang>
C++
<lang cpp>#include <iostream>
int main() {
uint_32 i = 0; while(true) { std::cout << ++i << std::endl; }
return 0;
}</lang>
Perl
<lang perl>my $i = 0; while(1) {
print ++$i . "\n";
} </lang>
Haskell
<lang haskell>mapM_ print [1..]</lang>