Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. package ascii.java;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class AsciiJava {
  6.  
  7. public static void main(String[] args) {
  8. Scanner S = new Scanner(System.in);
  9. System.out.println("input a word you wish to convert into ascii code:");
  10. String input = S.next();
  11. char[] a = input.toCharArray();
  12. for (char c : a) {
  13. int ascii = (int) c;
  14. System.out.println(ascii);
  15. }
  16. }
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement