Professional Documents
Culture Documents
Source Code:: Question: Write A Program To Print Numbers in The Range 1-999 in Words. It Should Also Display
Source Code:: Question: Write A Program To Print Numbers in The Range 1-999 in Words. It Should Also Display
Source Code:: Question: Write A Program To Print Numbers in The Range 1-999 in Words. It Should Also Display
Answer:
Source Code:
import java.util.*;
String one[]={" "," one"," two"," three"," four"," five"," six"," seven"," eight"," Nine"," ten","
eleven"," twelve"," thirteen"," fourteen","fifteen"," sixteen"," seventeen"," eighteen"," nineteen"};
String ten[]={" "," "," twenty"," thirty"," forty"," fifty"," sixty","seventy"," eighty"," ninety"};
int n=0;
n = scanf.nextInt();
{
System.out.println("Enter numbers in the range 1-999");
else
a.print_in_words((n/1000000000)," Hundred");
a.print_in_words(((n/1000)%100)," thousand");
a.print_in_words(((n/100)%10)," hundred");
a.print_in_words((n%100)," ");
Screenshots: