Here we create 30+ Pattern Program
public class Pattern {
public static void main(String[] args)
{
for (int i=1;i<=5;i++)
{
for (int j=1;j<=i;j++)
{
System.out.print("*");
}
System.out.println();
}
}
}
Output....
Pattern 2
public class Pattern1 {
public static void main(String[] args)
{
for (int i=1;i<=5;i++)
{
for (int j=5;j>=i;j--)
{
System.out.print("*");
}
System.out.println();
}
}
}
Output...
Pattern 3
public class Pattern2
{
public static void main(String[] args)
{
for (int i=1;i<=6;i++)
{
for (int j=5;j>=i;j--)
{
System.out.print(" ");
}
for (int k=1;k<=i;k++){
System.out.print("*");
}
System.out.println();
}
}
}
Output....
Pattern 4
public class Pattern3
{
public static void main(String[] args)
{
for (int i=1;i<=5;i++){
for (int j=1;j<=i;j++){
System.out.print(" ");
}
for (int k=5;k>=i;k--){
System.out.print("*");
}
System.out.println();
}
}
}
}
Output...
Click me for more pattern program
public class Pattern {
public static void main(String[] args)
{
for (int i=1;i<=5;i++)
{
for (int j=1;j<=i;j++)
{
System.out.print("*");
}
System.out.println();
}
}
}
Output....
Pattern 2
public class Pattern1 {
public static void main(String[] args)
{
for (int i=1;i<=5;i++)
{
for (int j=5;j>=i;j--)
{
System.out.print("*");
}
System.out.println();
}
}
}
Output...
Pattern 3
public class Pattern2
{
public static void main(String[] args)
{
for (int i=1;i<=6;i++)
{
for (int j=5;j>=i;j--)
{
System.out.print(" ");
}
for (int k=1;k<=i;k++){
System.out.print("*");
}
System.out.println();
}
}
}
Output....
public class Pattern3
{
public static void main(String[] args)
{
for (int i=1;i<=5;i++){
for (int j=1;j<=i;j++){
System.out.print(" ");
}
for (int k=5;k>=i;k--){
System.out.print("*");
}
System.out.println();
}
}
}
}
Output...
Click me for more pattern program
No comments:
Post a Comment