forked from jvm-coder/Java_Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathascii.java
More file actions
14 lines (14 loc) · 496 Bytes
/
ascii.java
File metadata and controls
14 lines (14 loc) · 496 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
public class PrintAsciiValueExample1
{
public static void main(String[] args)
{
// character whose ASCII value to be found
char ch1 = 'a';
char ch2 = 'b';
// variable that stores the integer value of the character
int asciivalue1 = ch1;
int asciivalue2 = ch2;
System.out.println("The ASCII value of " + ch1 + " is: " + asciivalue1);
System.out.println("The ASCII value of " + ch2 + " is: " + asciivalue2);
}
}