Advertisement
desislava_topuzakova

05. Print Part Of ASCII Table

Jan 23rd, 2021
720
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class PrintPartOfTheASCIITable_05 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int startCode = Integer.parseInt(scanner.nextLine());
  7.         int endCode = Integer.parseInt(scanner.nextLine());
  8.  
  9.         //1. обхождаме всички кодове от start до end
  10.         //2. за всеки един код -> взимаме символа и го печатаме
  11.  
  12.         for (int code = startCode; code <= endCode ; code++) {
  13.            System.out.print((char) code + " ");
  14.         }
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement