Write a Java program to print the ascii value of a given character.

 /* Write a Java program to print the ascii value of a given character.

Expected Output

The ASCII value of Z is :90 */


import java.util.*;

class Six

{

public static void main(String arg[])

{

Scanner obj = new Scanner( System.in );

char a;


System.out.print("\nEnter any symbole or character : ");

a = obj.next().charAt(0);



int b = a;


System.out.println("The ASCII value of " + a + " is => " + b );

}

}

More Information on our channel Programmer Community

please like , share and subscribe to get notifications of new videos....

To understand this program video will coming soon on our you tube channel



Comments

Popular posts from this blog

Design and Develop a java program to read marks of a student and print the total and average of marks using scanner class.

Write a Java program to convert seconds to hour, minute and seconds.