Tuesday, July 13, 2021

5. Print the ASCII value of the character 'h'.

 public class Main {

      public static void main(String[] args) {

          System.out.println((int)'h');

     }

}


NOTE:

  • ASCII  vlaue  is a character encoding scheme used for electronics communication.
  • Used System.out.println((int)'h'); to print the ASCII vlaue of h which is 104.
  • Didn't need Screen as  there was no input to ask from the user.

No comments:

Post a Comment