Print Digits
Problem Statement
Given a natural number N, your task is to print all the digits of the number in words. The words have to separated by space and in lowercase english letters.
static void Print_Digits(int N){
//Enter your code here
String values[]={"zero","one","two","three","four","five","six","seven","eight","nine"};
String num=Integer.toString(N);
for(int i=0;i<num.length();i++)
{
char index=num.charAt(i);
System.out.print(values[Character.getNumericValue(index)]+" ");
} }