Opening Hours :7AM to 9PM
import java.util.Scanner; class NumberToWord { // arrays to store word representations of digits from 0 to 9 private static final String[] units = { "", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen" }; private static final String[] tens = { "", // 0 "", // 1 "twenty", // 2 "thirty", // 3 "forty", // 4 "fifty", // 5 "sixty", // 6 "seventy", // 7 "eighty", // 8 "ninety" // 9 }; public static String convert(final int n) { if (n < 0) { return "minus " + convert(-n); } if (n < 20) { // for numbers between 0 and 19, we use the units array return units[n]; } if (n < 100) { // for numbers between 20 and 99, we use the tens array and the units array return tens[n / 10] + ((n % 10 != 0) ? " " : "") + units[n % 10]; } if (n < 1000) { // for numbers between 100 and 999, we recursively call convert with the quotient and remainder return units[n / 100] + " hundred" + ((n % 100 != 0) ? " and " : "") + convert(n % 100); } if (n < 1000000) { // for numbers between 1000 and 999999, we recursively call convert with the quotient and remainder return convert(n / 1000) + " thousand" + ((n % 1000 != 0) ? " " : "") + convert(n % 1000); } if (n < 1000000000) { // for numbers between 1000000 and 999999999, we recursively call convert with the quotient and remainder return convert(n / 1000000) + " million" + ((n % 1000000 != 0) ? " " : "") + convert(n % 1000000); } return convert(n / 1000000000) + " billion" + ((n % 1000000000 != 0) ? " " : "") + convert(n % 1000000000); } } public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Enter a number: "); int n = scanner.nextInt(); NumberToWord nw=new NumberToWord(); System.out.println("Word representation: " +nw.convert(n)); } }To use this program, you can compile and run it, and it will prompt you to enter a number. It will then print the word representation of the number. For example, if you enter the number 12345, the program will print Word representation: twelve thousand three hundred forty five.