Hi :
I am beginner in using java , I tried to add bignumber using java
my program enter numbers and add them , stop when user enter 0 then show the summation.
import java.util.Scanner ;
import java.math.BigDecimal;
public class CODE {
/**
* @param args
*/
public static void main(String[] args)
{
BigDecimal n1 , n2;
Scanner in = new Scanner (System.in) ;
n1 = in.nextBigDecimal() ;
do
{
n2 = in.nextBigDecimal() ;
if(n2.equals(0))
{
System.out.println(n2);
break ;
}
n1 = n1.add(n2);
}
while(!n2.equals(0));
}
}
The program runs but doesnot show the output !!!!!!!!!
I don't know why ??? can anyone help me!!!!!!
Thanks in advance