Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. import java.util.Scanner;
  2. /*for loop*/
  3. class ex6h
  4. {
  5. public static void main (String[] args)
  6. {
  7. int j;
  8. int x;
  9.  
  10. Scanner sc = new Scanner(System.in);
  11.  
  12. System.out.print("Please eneter a positive number: ");
  13. x = sc.nextInt();
  14. for(j = x; j >=0; x = x - 1)
  15. {
  16. System.out.println(x );
  17. }
  18.  
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement