Example program (Java): numbers to infinity
<< previous page This program starts at 1 and lists all the numbers to infinity (quite pointless).
1
2
3
4
5
6
7
8
9
10
11
12
class Testprogramm {
public static void main(String [] args) {
int zahl;
for(zahl = 1; 1 == 1; zahl = zahl + 1) {
System.out.println(zahl);
}
}
<< previous page Posted on 17.10.2011 | Last modified on 20.11.2016
Related articles
Example program (Java): addition of two numbers Example program (Java): area of a circle Example program (Java): random generator Example program (Java): Sum of all numbers from 1 to... Example program (Java): prime numbers from... to... Example program (Java): All factors of a number Example program (Java): gcd and lcm of two numbers Example program (Java): guess a number