In this example, We are going to convert number to words.
Code Description:
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:
public class NumberToWords{
|
Output of this program.
| C:\corejava>java NumberToWords words is :=zero words is :=One words is :=Nine words is :=One Hundrad C:\corejava> |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Convert Number To Words View All Comments
Post your Comment