Skip to content

Commit f1bd3b9

Browse files
authored
Create ASCII value
1 parent c75d47a commit f1bd3b9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

ASCII value

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
public class PrintAsciiValueExample1
2+
{
3+
public static void main(String[] args)
4+
{
5+
// character whose ASCII value to be found
6+
char ch1 = 'a';
7+
char ch2 = 'b';
8+
// variable that stores the integer value of the character
9+
int asciivalue1 = ch1;
10+
int asciivalue2 = ch2;
11+
System.out.println("The ASCII value of " + ch1 + " is: " + asciivalue1);
12+
System.out.println("The ASCII value of " + ch2 + " is: " + asciivalue2);
13+
}
14+
}

0 commit comments

Comments
 (0)