From 5b4638ffe1e85f8e1e5371cbb6d3b199698abe3e Mon Sep 17 00:00:00 2001 From: Tobisenzu <92511304+Tobisenzu@users.noreply.github.com> Date: Wed, 25 Jan 2023 19:18:54 +0530 Subject: [PATCH] Create Nested Loop --- Nested Loop | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Nested Loop diff --git a/Nested Loop b/Nested Loop new file mode 100644 index 0000000..3156e39 --- /dev/null +++ b/Nested Loop @@ -0,0 +1,48 @@ +// Creating a pattern +package Nestedloop; +import java.util.*; + +public class Pattern { + + public static void main(String[] args) { + // TODO Auto-generated method stub + System.out.println("Enter the height"); + Scanner sc=new Scanner(System.in); + int i=sc.nextInt(); + for(int k=1;k<=i;k++) { + for(int j=1;j<=k;j++) + System.out.print("*"); + System.out.println(); + } + + } + +} + + +package Nestedloop; +import java.util.*; + +public class twod { + + public static void main(String[] args) { + Scanner sc=new Scanner(System.in); + int row=sc.nextInt(); + int col=sc.nextInt(); + int mat[][]=new int [row][col]; + for(int i=0;i