In this section, you will learn how to add two big numbers. For adding two numbers implement two big decimal numbers then apply the Sum() method that takes both numbers. Now, you will have to define it and use the add() method to add both numbers. Finally, the result will be displayed on the command prompt (DOS prompt).
This is the constructor of BigDecimal class. It translates the data into BigDecimal.
This method is used to add the two BigDecimal numbers.
Here is the code of program:
Output of program:
Sum of two BigDecimal numbers: 150.002849999999995134203345514833927154
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: June 11, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles