0
I am start learning of java.. My question is how to convert numerical value to alpha Eric Eg-i want a program for if we give input as 100 then output should be ONEHUNDRED
2 odpowiedzi
0
you can do this by using switch case statement using following code
public class Program {
public static void main(String[] args) {
int a = 3;
switch(a) {
case 1:
System.out.println("one");
break;
case 2:
System.out.println("Two");
break;
case 3:
System.out.println("three");
break;
}
}
}
this will print three on screen
0
Many ways to implement were suggested here.
http://stackoverflow.com/questions/3911966/how-to-convert-number-to-words-in-java