Skip to content

Instantly share code, notes, and snippets.

@0x000000AC
Created November 30, 2012 21:19
Show Gist options
  • Save 0x000000AC/4178705 to your computer and use it in GitHub Desktop.
Save 0x000000AC/4178705 to your computer and use it in GitHub Desktop.
I wanted to figure out how to print something a given number of times with a for loop
/***********************************************
* printLoop.java
* Aaron P. Clark
*
* Created from pseudocode in Ch. 2 of Park Univ.
* book. I wanted to figure out how to print something
* a given number of times.
***********************************************/
// Created from pseudocode in Ch. 2 of Park University book.
//I wanted to figure out how to print something a given number of times.
import java.util.Scanner;
public class printLoop
{
public static void main(String args[])
{
for (int i =1; i<=2; i++) // For loop starts at 1 and ends at 2
{
System.out.println("Talking");
}
System.out.println("End of Count!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment