Write a java program to find ASCII value of a given letter.

The full form of ASCII is American Standard code for information interchange. Each letter of keyboard can be represented through a certain ASCII code. The aim of this project is to display the ASCII code of the given letter. As we have not discussed the user input till this time so we will not use that. Directly we will assign a character to a char type variable and find out its ASCII code and display it on screen.

If you want to learn Java from Beginning please Click Here.

// Project to find ascii value of any character
public class Project1{

public static void main(String[] args) {

char x = ‘A’;
int y = x;

System.out.println(“ASCII value of “+ x +” is: ” + y);

}
}

 

My Self Subrat Dash. I have completed my MSc in Information Technology. Since last 12 years i am teaching Math and Computer at TTRC Computer Institute situated at Rayagada, Odisha, India. I believe in conceptual learning, so i explain each and every concept with demos and examples, which makes it easier to understand.

    1 Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

error: Content is protected !!