Skip to content

Commit 5885685

Browse files
committed
ASCII Value of Character
1 parent bbad286 commit 5885685

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

Basic-Java/AsciiOfCharacter.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import java.util.Scanner;
2+
3+
public class AsciiOfCharacter {
4+
5+
public static void main(String[] args) {
6+
7+
System.out.println("Program to get ASCII Value of Character.\n---");
8+
Scanner sm = new Scanner(System.in);
9+
10+
System.out.print("Enter the Character: ");
11+
char input = sm.next().charAt(0);
12+
13+
int output = (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+
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ ___
2222
| 7 | [Reversing a Number](/Basic-Java/ReverseNumber.java) | A Simple Program to reverse a number | String |
2323
| 8 | [Binary Validation](/Basic-Java/ValidateBinary.java) | A Program which checks if the Input String is a Binary Number or not | Modulus |
2424
| 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 |
2526

2627
### List of Other Programs:
2728

0 commit comments

Comments
 (0)