Created
July 1, 2012 08:04
-
-
Save chestergrant/3027478 to your computer and use it in GitHub Desktop.
Print my first name 100 times, and every count of 20 print my last name. Part of "1000 programming exercises by Chess"
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
public class InterweavingNames { | |
public static void main(String[] args) { | |
String firstname = "Chester"; | |
String lastname = "Grant"; | |
for(int i =1; i<=100; i++){ | |
System.out.print(firstname); | |
if((i % 20) == 0){ | |
System.out.print(" "+lastname); | |
} | |
System.out.println(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment