Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /*for loop*/
- class ex6h
- {
- public static void main (String[] args)
- {
- int j;
- int x;
- Scanner sc = new Scanner(System.in);
- System.out.print("Please eneter a positive number: ");
- x = sc.nextInt();
- for(j = x; j >=0; x = x - 1)
- {
- System.out.println(x );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement