Advertisement
CamiloCastilla

Untitled

Dec 12th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.     public static void main(String[] args) {
  7.         Scanner keyboard = new Scanner(System.in);
  8.  
  9.         System.out.println("Type in a message, and I'll display it ten times.");
  10.         System.out.print("Message: ");
  11.         String message = keyboard.nextLine();
  12.  
  13.         for (int n = 2; n <= 20; n = n + 2) {
  14.             System.out.print(n + ". " + message);
  15.         }
  16.  
  17.     }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement