Get ASCII value of Char in Java || Basic Programming || Java Programming
In this program, we are going to print the ASCII value of user entered character in Java Programming Language.


// Program to print the ASCII Value of a Character
import java.util.*;

class Class {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        char ch;
        System.out.print("Enter a Character: ");
        ch = sc.next().charAt(0);
        System.out.println((int)ch);
    }
}

#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post