TheBulgarianWolf

Print Part Of The ASCII Table

Apr 21st, 2020
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. package softuni;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class SoftUni {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner sc = new Scanner(System.in);
  9.         int sum = 0;
  10.         System.out.print("Enter the first index of the ASCII table: ");
  11.         int index1 = Integer.parseInt(sc.nextLine());
  12.         System.out.print("Enter the last index of the ASCII table: ");
  13.         int index2 = Integer.parseInt(sc.nextLine());
  14.        
  15.         for(int i = index1;i<= index2;i++){
  16.             char symbol = (char)(i);
  17.             System.err.print(symbol + " ");
  18.         }    
  19.     }
  20.  
  21. }
Add Comment
Please, Sign In to add comment