Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ascii.java;
- import java.util.Scanner;
- public class AsciiJava {
- public static void main(String[] args) {
- Scanner S = new Scanner(System.in);
- System.out.println("input a word you wish to convert into ascii code:");
- String input = S.next();
- char[] a = input.toCharArray();
- for (char c : a) {
- int ascii = (int) c;
- System.out.println(ascii);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement