Skip to content

Commit

Permalink
feat(4.2.2): Finish U4_L2_Activity_One
Browse files Browse the repository at this point in the history
  • Loading branch information
101zh committed Oct 25, 2023
1 parent 3763b91 commit 70530f4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/main/java/Unit4/U4_L2_Activity_Two.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package Unit4;

import java.util.Scanner;

public class U4_L2_Activity_Two {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);

System.out.println("Enter a positive integer:");
System.out.print("> ");
int num = scanner.nextInt();

int index=0;
while(num>0){
System.out.println((num%10)* (int) Math.pow(10, index));
index++;
num/=10;
}

scanner.close();

}
}

0 comments on commit 70530f4

Please sign in to comment.