Inverted Number Pattern
- Get link
- X
- Other Apps
Pattern for N = 4
4444
333
22
1
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k; for(int i=n; i>=1;i--) { for(int j=1; j<=i;j++) { System.out.print(i); } System.out.println(); } } }
- Get link
- X
- Other Apps
Comments
Post a Comment