Created
November 30, 2012 21:12
-
-
Save 0x000000AC/4178658 to your computer and use it in GitHub Desktop.
Prints "happy birthday" 100x based on a counter in a while loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********************************************** | |
* HappyBirthday.java | |
* Aaron P. Clark | |
* | |
* Based on the pseudocode while loop on p.37 in Ch 2. | |
* prints "Happy birthday!" 100x | |
***********************************************/ | |
public class HappyBirthday | |
{ | |
public static void main(String args[]) | |
{ | |
int count; | |
count = 1; | |
while (count <=100) // For loop starts at 1 and ends at 100 | |
{ | |
System.out.println("Happy birthday!"); | |
count++; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice one!.I'm gonna use this :) Cheers!