Advertisement
IanO-B

Untitled

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