ninadchaudhari
What's up !
Hi,
Source code
I am totally confused why the loop is just executed once !
It is compiled with no errors
but during run time, the loop is excuted once though because of the println function, i can notice the value of i to be non zero !!
Just passed a 3 digit no. as argument ...
please can any one explain ???
Source code
Code:
public static void main(String args[])
{
System.out.println("Enter the Number");
int num = Integer.parseInt(args[0]);
int cnt=1;
double i;
do{
i = (num/(Math.pow(10,cnt)));
cnt++;
System.out.println(cnt+" "+i);
}while(i == 0);
}
I am totally confused why the loop is just executed once !
It is compiled with no errors
but during run time, the loop is excuted once though because of the println function, i can notice the value of i to be non zero !!
Just passed a 3 digit no. as argument ...
please can any one explain ???

thanks again for clearing the problem
.
