Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /*
- * Justin Herrera
- * COSC 1336
- * pp 5.
- *
- */
- public class CharPerLine {
- public static void main(String[] args) {
- int length;
- System.out.println("Enter a sentence");
- Scanner scan = new Scanner ( System.in );
- String choice = scan.nextLine();
- System.out.println(choice.charAt(1));
- length = choice.length();
- // initialize // condition // update
- for (int count=0; count < length; count++) {
- System.out.println(choice.charAt(count));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement