import java.util.*;
class seqInteger {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
System.out.print(" Please Enter any integer: ");
int no=sc.nextInt();
do{
System.out.print(no+" ");
no++;
}while(no>0);
sc.close();
}
}
I got the out only entered no.
Could you explain ? why the do while loop exit.
I am expecting…
Input : -5
output: -5 -4 -3 -2 -1 0