Pattern 15

A

AB

ABC

ABCD

ABCDE

package Patterns;
class p1
{
public static void main()
    {
for(int i=1;i<=5;i++)
        {
int alphabet=65;
for(int j=1;j<=i;j++)
            {
System.out.print((char)alphabet);
alphabet++;
            }
System.out.println();
        }
    }
}

Pattern 16

J

AA

VVV

AAAA

package Patterns;
class p2
{
public static void main()
    {
        String str="JAVA";
intlen=str.length();
for(int i=0;i<len;i++)
        {
for(int j=0;j<=i;j++)
            {
charval=str.charAt(i);
System.out.print(val);
            }
System.out.println();
        }
    }
}

Pattern 17

J

JA

JAV

JAVA

package Patterns;
class p3
{
public static void main()
    {
        String str="JAVA";
intlen=str.length();
for(int i=0;i<len;i++)
        {
for(int j=0;j<=i;j++)
            {
charval=str.charAt(j);
System.out.print(val);
            }
System.out.println();
        }
    }
}

Pattern 18

JJJJ

AAA

VV

A

package Patterns;
class p4
{
public static void main()
    {
        String str="JAVA";
intlen=str.length();
for(int i=0;i<len;i++)
        {
for(int j=len-1;j>=i;j--)
            {
charval=str.charAt(i);
System.out.print(val);
            }
System.out.println();
        }
    }
}

Pattern 19

LUEJB

UEJBL

EJBLU

JBLUE

package Patterns;
class p5
{
public static void main()
    {
        String str="BLUEJ";
intlen=str.length();
for(int i=0;i<len-1;i++)
        {
charval=str.charAt(i);
            String str1=str.substring(i+1,len)+str.substring(0,i+1);   
System.out.println(str1);
        }
    }
}

LEAVE A REPLY

Please enter your comment!
Please enter your name here