Programming for Designers

Class announcements for COMP1400

Programming for Designers random header image

Loops

October 16th, 2011 · No Comments · Uncategorized

To save people constantly looking up how to do loops in the lecture notes, here’s a simple example that prints the numbers 0 to 4 inclusive. As a for loop: for(int i=0; i<5; i++) { System.out.println(i); }   As a while loop: int i=0; while(i<5) { System.out.println(i); i++; }

[Read more →]

Tags: