System.out.println("Program to get ASCII Value of Character.\n---");
8
+
Scannersm = newScanner(System.in);
9
+
10
+
System.out.print("Enter the Character: ");
11
+
charinput = sm.next().charAt(0);
12
+
13
+
intoutput = (char)input;
14
+
15
+
System.out.println("The ASCII Value of '"+input+"' is: "+output);
16
+
17
+
sm.close();
18
+
System.out.println("---\nThe Program has ended.");
19
+
System.exit(0);
20
+
21
+
}
22
+
23
+
24
+
25
+
}
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@ ___
22
22
| 7 |[Reversing a Number](/Basic-Java/ReverseNumber.java)| A Simple Program to reverse a number | String |
23
23
| 8 |[Binary Validation](/Basic-Java/ValidateBinary.java)| A Program which checks if the Input String is a Binary Number or not | Modulus |
24
24
| 9 |[Prime Number Checker](/Basic-Java/PrimeNumberChecker.java)| A Program to check if the entered number is a Prime Number or not. | if/else, for loops |
25
+
| 10 |[ASCII Value Of Character](/Basic-Java/AsciiOfCharacter.java)| A Program to find ASCII Value of a Character entered. | TypeCasting |
0 commit comments