06/03/2023

How to Print ASCII Value in Java | ASCII Value

Write a Program to Print ASCII Value in Java. How to Print ASCII Value in Java. The user has to enter the Character and the program should print the ASCII Value in Java Language. How to convert characters to ASCII Values in Java. ASCII was developed from telegraph code. Its first commercial use was as a seven-bit teleprinter code promoted by Bell data services. 

Work on the ASCII standard began on October 6, 1960, with the first meeting of the American Standards Association's (ASA) (now the American National Standards Institute or ANSI) X 3.2 subcommittee. The first edition of the standard was published in 1963. Full Form of ASCII Is ( American Standard Code for Information Interchange). Print ASCII Value in Java.

ASCII Code Table – Printable, Non-Printable & Extended PDF.

Note: The class name should be the same as the program name

See Also C++ Program To Print ASCII Value Of Character

How to Print ASCII Value in Java


import java.util.Scanner;

/*How to Print ASCII Value in Java*/

class ascii //class name
{

	public static void main(String args[]) {

		System.out.print("Enter Any Character to Print ASCII Value in Java: ");
		Scanner sc = new Scanner(System.in);
		char ch = sc.next().charAt(0);

		int ascii = ch;

		System.out.println("ASCII Value is: " + ascii);
	}
}

See Also C Program To Print ASCII Value Of Character

Print ASCII Value in Java Output 


Print ASCII Value in Java Output

Similar to ASCII Value in Java


Previous Post
Next Post

post written by:

Hi, I’m Ghanendra Yadav, SEO Expert, Professional Blogger, Programmer, and UI Developer. Get a Solution of More Than 500+ Programming Problems, and Practice All Programs in C, C++, and Java Languages. Get a Competitive Website Solution also Ie. Hackerrank Solutions and Geeksforgeeks Solutions. If You Are Interested to Learn a C Programming Language and You Don't Have Experience in Any Programming, You Should Start with a C Programming Language, Read: List of Format Specifiers in C.
Follow Me

0 Comments: