Program to print ASCII Value of all digits of a given number | Java program to convert the digits of a number to its ASCII values ; Function to convert digits of N to respective ASCII values ; Driver Code
import java . util . * ; class GFG { static void convertToASCII ( int N ) { String num = Integer . toString ( N ) ; for ( char ch : num . toCharArray ( ) ) { System . out . print ( ch + " ▁ ( " + ( int ) ch + ")NEW_LINE"); } } public static void main ( String [ ] args ) { int N = 36 ; convertToASCII ( N ) ; } }