In this example, We are going to convert number to words.
The following program takes the two static array of Strings . Here, we are going to make a method in which a parameter of integer type is passed. After that this program is going to create an another method of name convert() . In the main class create an object, and pass the value in object (num) . It displays the string representing the number.
Here is the code of this program:
Output of this program.
words is :=zero
words is :=One
words is :=Nine
words is :=One Hundrad
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: July 10, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles