Practice Program (Java)
Vasanth S

Vasanth S @vasanthvnr_31

About: I am Vasanth from the department of Information Technology, currently pursing my UG degree. I have been learning the flutter app development and also a Java programing language.

Joined:
Jan 27, 2025

Practice Program (Java)

Publish Date: Feb 15
1 0

In java today practiced the program of curly braces pattern program

output :
{}
{} {{}}
{} {{}} {{{}}}
{} {{}} {{{}}} {{{{}}}}

public class braces_pattern {
public static void main(String[] args) {
String a="{";
String b="}";
int A=4;
for (int i=1;i<A;i++){
for (int j=1;j<i+1;j++){
for (int k=j;k<=j;k++){
System.out.print(a);
}
for(int k=j;k<=j;k++){
System.out.print(b);
}
}
System.out.println();
}
}
}

java

leetcode

patterns

Comments 0 total

    Add comment