Last Updated: 14 March, 2023
On this tutorial page we are going to learn how to write a Java program to print ASCII value of each character.
ASCII (American Standard Code for Information Interchange) is a character encoding standard used to represent text in computers. Each character in the ASCII table is assigned a unique code or value between 0 and 127, including uppercase and lowercase letters, digits, punctuation marks, and special characters.
Here's a Java program to find the ASCII value of a given character:
Example 1 :
Output
The ASCII value of s is: 115
The ASCII value of s is: 115
Example 2 :
Output
Enter the character: G
The ASCII value of G is: 71
The ASCII value of G is: 71
Example 3 :
Output
String: SMILE
Character: S - ASCII value: 83
Character: M - ASCII value: 77
Character: I - ASCII value: 73
Character: L - ASCII value: 76
Character: E - ASCII value: 69
ASCII Value: 83 Character: S
ASCII Value: 77 Character: M
ASCII Value: 73 Character: I
ASCII Value: 76 Character: L
ASCII Value: 69 Character: E
That's all guys, hope this Java Program is helpful for you.
Happy Learning... 😀
feedback@javabytechie.com