CppBuzz.com
  
Home C C++ Java Python Perl PHP SQL JavaScript Linux Online Test Forum

Java program to print ascii value of any char

Home » Java » Java program to print ascii value of any char

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner read = new Scanner(System.in); String str = read.nextLine(); int ascii = (int) str.charAt(0); System.out.println("ASCII value is : " + ascii); } }

[Contribute to this Website]