# Creating Number Patterns In Java

Creating number or symbol patterns is used to check command of a programmer or a student on for loop. In short its done just for practicing for loop.

Here are some common number patterns :

Pattern 1.
To Print this pattern use the following code:

```public class numPtr {
public static void main( String arg[]){
for(int i=1;i<=5;i++){

for(int j=1;j<=i;j++){
System.out.print(j);
}
System.out.println();
}
}
}
```

Pattern 2.
To Print this pattern use the following code:

```public class numPtr {
public static void main( String arg[]){
for(int i=1;i<=5;i++){
for(int j=5;j>=i;j--){
System.out.print(j);
}
System.out.println();
}
}
}
```

Pattern 3.
To Print this pattern use the following code:
```public class numPtr {
public static void main( String arg[]){
for(int i=1,r=5;i<=5;i++,r--){
for(int j=1;j<=r;j++){
System.out.print(j);
}
System.out.println();        }
}
}
```

Pattern 4.

To Print this pattern use the following code:
```public class numPtr {
public static void main( String arg[]){
int ck=0,c=2;
while(c>0){
if(ck==0){
for(int i=1;i<=5;i++){
for(int j=1;j<=i;j++){
System.out.print(j);
}
System.out.println();         }
ck++;
} else{
for(int i=1,r=5-1;i<=5-1;i++,r--){
for(int j=1;j<=r;j++){
System.out.print(j);            }
System.out.println();
}
}
c--;
}

}
}

```
Pattern 5.

To Print this pattern use the following code:
```public class numPtr {
public static void main( String arg[]){
int ck=0,c=2;
while(c>0){
if(ck==0){
for(int i=1,r=5;i<=5;i++,r--){
for(int j=1;j<=r;j++){
System.out.print(j);
}
System.out.println();        }
ck++;
} else{
for(int i=2;i<=5;i++){
for(int j=1;j<=i;j++){
System.out.print(j);            }
System.out.println();
}
}
c--;
}

}
}
```
Author Note: All the above examples gives output till 5, you can change it accordingly by changing the conditions.

1 = 1
1 + 2 = 3
1 + 2 + 3 = 6
1 + 2 + 3 + 4 = 10
1 + 2 + 3 + 4 + 5 = 15
1 + 2 + 3 + 4 + 5 + 6 = 21
1 + 2 + 3 + 4 + 5 + 6 + 7 = 28
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 = 36
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 = 45
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55

This comment has been removed by the author.

Hello,
How to Print
1*2*3
7*8*9
4*5*6
where n=3

Program for
1*2*3
7*8*9
4*5*6

class Pattern
{

public static void main(String []args)
{
int n=3;
int m=1; int p=(n*2)+1;
for(int i=1;i<=n;i++)
{
if(i!=2){
for(int j=1;j<(n*2);j++)
{
if(j%2!=0)
{System.out.print(m);
m++;}
else
{
System.out.print("*");
}
}}
else
{
for(int j=1;j<(n*2);j++)
{
if(j%2!=0)
{System.out.print(p);
p++;}
else
{
System.out.print("*");
}
}
}

System.out.println("");

}
}
}

This comment has been removed by the author.

Program for
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15

class Pattern
{

public static void main(String []args)
{
int n=5;
int m=1;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=i;j++)
{
System.out.print(m+" ");
m++;
}
System.out.println("");

}
}
}

1 = 1
1 + 2 = 3
1 + 2 + 3 = 6
1 + 2 + 3 + 4 = 10
1 + 2 + 3 + 4 + 5 = 15
1 + 2 + 3 + 4 + 5 + 6 = 21
1 + 2 + 3 + 4 + 5 + 6 + 7 = 28
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 = 36
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 = 45
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55

Hi ,can u plz help me out with this program?
A java program to print the series 3 3 4 8 10 30 33 upto n terms?

sir can u write java program for
12345 54321
1234 4321
123 321
12 21
1 1
1 1
12 21
123 321
1234 4321
12345 54321

1
2 6
3 7 10
4 8 11
5 9 12

Program for
12345 54321
1234 4321
123 321
12 21
1 1
1 1
12 21
123 321
1234 4321
12345 54321

public class Patterns
{
public static void main(String[] args)
{
int n=5;
for(int i=1;i<=n;i++)
{ int m=1;
for (int j=i;j<=n;j++)
{
System.out.print(m);m++;
}

System.out.print(" ");m--;

for (int j=i;j<=n;j++)
{
System.out.print(m);--m;
}
System.out.println("");
}

for(int k=1;k<=n;k++)
{ int a=1;

for(int p=1;p<=k;p++)
{
System.out.print(a);a++;
}

System.out.print(" ");a--;

for(int p=1;p<=k;p++)
{
System.out.print(a);--a;
}
System.out.println("");
}
}
}

This comment has been removed by the author.

Can you do this pattern please?
*********
*********
*********
*********

class DEmo3
{
public static void main(String[] args)
{
int n=7;
int k=n/2+1;
for(int i=1;i<=n;i++)
{

if(i<=n/2)
{
for(int j=4;j>=i;j--)
{

System.out.print(k);

}
k--;
}
else{
for(int l=1;l<=k;l++)
{
System.out.print(k);
}
k++;
}
System.out.println();
}
}
}

Program for
*********
*********
*********
*********

public class Pattern
{
public static void main(String[] args)
{
for(int i=1;i<=4;i++)
{
for(int j=1;j<=9;j++)
{
System.out.print("*");
}
System.out.println("");
}
}
}

7
14 15
28 29 30 31
56 57 58 59 60 61 62 63

print series for 7,10,8,11,9,12

print series for 7,10,8,11,9,12

This comment has been removed by the author.

Program for
7
14 15
28 29 30 31
56 57 58 59 60 61 62 63

public class Pattern
{
public static void main(String[] args)
{
int n=7, m=1;
for(int i=1;i<=4;i++)
{
for(int j=1;j<=m;j++)
{ int p=n;
p=p+j-1;
System.out.print(p+" ");
}
System.out.println("");
m *=2;
n *=2;
}
}
}

1
2*3
4*5*6
7*8*9*10
4*5*6
2*3
1

10
10 9
10 9 8
10 9 8 7
10 9 8 7 6
and so on, i was hoping you could tell me how to do this with user input

10
10 9
10 9 8
10 9 8 7
10 9 8 7 6
and so on, i was hoping you could tell me how to do this with user input

sir.. plz solve this problem

i/p=number of rows/columns

pattern is:
1 2 3 4 5
16 17 18 19 6
15 24 25 20 7
14 23 22 21 8
13 12 11 10 9

May i know the code of this pattern pleasee
4 4 4 4
4 4 4 4
4 4 4 4
4 4 4 4

Program for
10
10 9
10 9 8
10 9 8 7
10 9 8 7 6

public class Pattern
{
public static void main(String[] args)
{
int rows=5;
for(int i=1;i<=rows;i++)
{ int n=10;
for (int j=1;j<=i;j++)
{
System.out.print(n+" ");
n--;
}
System.out.println("");
}
}
}

Program for
4 4 4 4
4 4 4 4
4 4 4 4
4 4 4 4

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

Can you provide the code for printing the below pattern:
1*2*3*4
9*10*11*12
13*14*15*16
5*6*7*8

Hello

private static void squarePattern( int input )
{
String evencount = "" , oddcount = "" ;
int initialVal = 1 ;
for ( int count = 1; count <= input; count++ )
{
String rowValue = "" ;
if ( count % 2 != 0 )
{
for ( int oddcounter = 1; oddcounter <= input; oddcounter++ )
{
rowValue = rowValue + initialVal + "*" ;
initialVal++ ;
}
rowValue = rowValue.substring( 0, ( rowValue.length() - 1 ) ) + "\n" ;
oddcount = oddcount + rowValue ;
}
else
{
for ( int evencounter = 1; evencounter <= input; evencounter++ )
{
rowValue = rowValue + initialVal + "*" ;
initialVal++ ;
}
rowValue = "\n" + rowValue.substring( 0, ( rowValue.length() - 1 ) ) ;
evencount = rowValue + evencount ;
}
}
System.out.println( "\n\nMatrix is :\n" + oddcount + evencount.substring( 1 ) ) ;
}

Sir i need output as we give input as
1 2 3
4 5 6
7 8 9
output as
1 2 3
8 9 4
7 6 5

This comment has been removed by the author.
This comment has been removed by the author.

what will be the code from numbers pattern in triangle
1
121
12321
1234321

Kindly please tell me the pattern of this code
3
33
333

Sir please kindly tell me the code for this pattern
3
333
3

123454321
12344321
123321
1221
11
Hi Nirvana, Please solve this soon. It is urgent.

Can you merge the two Patters like (Please post the answer as fast as you can,Thank You)
1######
12#####
123####
1234###
12345##
123456#
1234567

*****
* *
* *
* *
* *
*****
sir give me this code pls....!

Please tell me how to create the pattern 123
246
369 By the nested for loop

This comment has been removed by the author.

what is the code for this out put below?
like this
NO Odd Numbers
1 1
2 1 3
3 1 3 5

Can you give me the code for
1
1 2
1 2 3
1 2 3 4

This comment has been removed by the author.

Hi Arun,
Here's the code:
for (int i = 1; i < 5; i++){
for(int j = 1; j <= i; j++){
System.out.print(j+" ");
}
System.out.println("");
}

how to write a program for star pattern like:
* *
* *
* *
*
* *
* *
* *

This comment has been removed by the author.

I want a program that counts the number of continuous alphabet and no. of vowel pairs.
For e.g. The ghost is waiting quietly for Ram in deep silence.
alphabet pairs: gh,ab, hi, st etc.
vowel pairs : ai,ui etc.

1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25

what will be the simple bluej code for:
1
12
123
1234
12345
1234
123
12
1

public class pattern
{
public static void main()
{
int i,j,k;
for(i=1;i<=9;i+=2)
{
for(j=i;j<=9;j+=2)
{
System.out.print(j);
}
for(k=1;k<=(i-1);k+=2)
{
System.out.print(k);
}
System.out.println();
}
}
}

public class pattern10
{
public static void main()
{
int i,j,k;
for(i=1;i<=9;i+=2)
{
for(j=i;j<=9;j+=2)
{
System.out.print(j);
}
for(k=1;k<=(i-1);k+=2)
{
System.out.print(k);
}
System.out.println();
}
}
}

1
12
123
1234
12345
123456

B;
123456
12345
1234
123
12
1

C;
1
21
321
4321
54321
654321

D;
123456
12345
1234
123
12
1

Y
X Y
Y X Y
X Y X Y
Y X Y X Y

how to print this pattern:
9 8 7 6 5 4 3 2 1
8 7 6 5 4 3 2 1
7 6 5 4 3 2 1
6 5 4 3 2 1
5 4 3 2 1
4 3 2 1
3 2 1
2 1
1

how to print this pattern:
9 8 7 6 5 4 3 2 1
8 7 6 5 4 3 2 1
7 6 5 4 3 2 1
6 5 4 3 2 1
5 4 3 2 1
4 3 2 1
3 2 1
2 1
1

plzz code for this pattern
ABCDEDCBA
ABCD*DCBA
ABC***CBA
AB*****BA
A*******A
AB*****BA
ABC***CBA
ABCD*DCBA
ABCDEDCBA

plzz code for this pattern
ABCDEDCBA
ABCD*DCBA
ABC***CBA
AB*****BA
A*******A
AB*****BA
ABC***CBA
ABCD*DCBA
ABCDEDCBA

can u plzz hlep me in printing the following pattern
1
2 3
4 5 6
7 8 9 10

Sir give me code for the following pattern
1
1 2
1 2 4
1 2 4 8
1 2 4 8 16...

1 2 3 4 5 6 7 8
1 2 3 4 5 6
1 2 3 4
1 2

1 2 3 4 5 6 7 8
1 2 3 4 5 6
1 2 3 4
1 2

12345678
1234567
123456
12345
1234

how to print the program of
1
31
531
7531
9753

How to create pattern :
1 1
1 2 2 1
1 2 3 3 2 1
1 2 3 4 3 2 1

can you please write a code for the following pattern using 2D array?
0
1 2
3 4 5
6 7 8 9

please give me the code for
1
21
321
4321
54321

12345678
43218765
23456789
54329876
345678910
654310987

What will be the code for this patetrn:

1
10
101
1010
10101

can U code this output I badly need it thanks!
.....1
....21
...321
..4321
.54321
654321

- - - - 1
- - - 2 1
- - 3 2 1
- 4 3 2 1
5 4 3 2 1
and
- - 1
- 2 1 2
3 2 1 2 3
- 2 1 2
- - 1
lastly
1 2 3 4 5
2 - - - 4
3 - - - 3
4 - - - 2
5 4 3 2 1

- - 1
- 2 1 2
3 2 1 2 3
- 2 1 2
- - 1

and
- - - - 1
- - - 2 1
- - 3 2 1
- 4 3 2 1
5 4 3 2 1

lastly

1 2 3 4 5
2 - - - 4
3 - - - 3
4 - - - 2
5 4 3 2 1

Hi my name is KSHITIJ TYAGI

ABCDEEDCBA
ABCD DCBA
ABC CBA
AB BA
A A

1
1 1
1 0 1
1 1 1 1
1 1 1 1 1 how to print this pattern in java

Hi my name is KSHITIJ TYAGI

ABCDEEDCBA
ABCD--DCBA
ABC----CBA
AB------BA
A--------A

Two test cases are when I enter

1) input-3
333
313
323
333

2)input-5
55555
55155
55255
55355
55455
55555

55555
1111
555
11
5

This comment has been removed by the author.

Hi Please send code for below pattern
a
a b a
a b c b a
a b a
a

thanks

plz send this
#
0 #
# 0 #
0 # 0 #
# 0 # 0 #

How can I make this program
123454321
1234 4321
123 321
12 21
1 1

Sir what will be the code for
321
21
1

Java code for this pattern..
12345
12341
12312
12123
11234

public class Patterns
{
public static void main(String[] args)
{
int x=1,y=6,z=10;
for(int i=1;i<=3;i++)
{
for(int j=1;j<=i;j++)
{
if(j==1)
{
System.out.print(x);
x++;
}
else if(j==2)
{
System.out.print(y);
y++;
}
else
{
System.out.print(z);
z++;
}
}
System.out.println();
}
}
}

1
2 4
1 3 5
2 4 6 8
1 3 5 7 9

HELLO I AM ANU AND I'D LIKE SOLUTION PROGRAM FOR GIVEN 2 PATTERNS

1) INPUT 3

1 1 1 1 1
1 2 2 2 1
1 2 3 2 1
1 2 2 2 1
1 1 1 1 1

2) INPUT 4

1 2 3 4
12 13 14 5
11 16 15 6
10 9 8 7

If(3)
1*2*3
7*8*9
4*5*6

If(4)
1*2*3*4
9*10*11*12
13*14*15*16
5*6*7*8

If(5)
1*2*3*4*5
11*12*13*14*15
21*22*23*23*25
16*17*18*19*20
6*7*8*9*10

plz draw this pyramid

1 1
22 22
333 333
4444 4444
55555 55555

Please can you help me with the code of this pattern 1
1 2 1
1 2 4 2 1
1 2 4 16 4 2 1

NewYear-2017-1111
NewYear-2017-1112
Newyear-2017-1113
NewYear-2017-1114
NewYear-2017-1115
.
.
.
.
.
.
.
NewYear-2017-9999

Pattern for
*****
*123*
*456*
*789*
*****

Pattern for
*****
*123*
*456*
*789*
*****

Pattern for
*****
*123*
*456*
*789*
*****

Pattern for
*****
*123*
*456*
*789*
*****

what a complex & mathmetical logic bro... tell me honestly how you took to create this :P

really complex one bro, kudos for this.. tell me honestly, how much time you took to create this logic ??

How to print the following ?
a
aba
abcba
aba
a

can u help me with this pattern
1
2 4
3 5 7
6 8 10 12

how to print the pattern

11
121
1331
14641

I need help with this...
1******
12*****
123****
1234***
12345**
123456*
1234567

1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1

how could i solve this

0
1 1
2 3 5
8 13 21 34

11
12 22
13 23 33
14 24 34 44
15 25 35 45 55
What will be its coding

11
12 22
13 23 33
14 24 34 44
15 25 35 45 55
What will be its coding

plz solve ths pattern to print..

1
2 3
6 5 4
7 8 9 10

class DempPattern{
public static void main(String [] args){
int k =1;
System.out.println("*****");
for(int i = 0;i<3;i++){
System.out.print("*");
for(int j = 0 ;j < 3;j++){
System.out.print(k);
k = k+1;
}
System.out.println("*");
}
System.out.println("*****");
}
}

class SystemDemo{
public static void main(String [] args){
int k =1;
for(int i =4; i > 0; i--){
for(int j =4; j >= i;j--){
System.out.print(k+" ");
k=k+1;
}

System.out.println();
}
}
}

sir do you even help with series or sum of series

HOW TO PRINT THIS
1
2 3
4 5 6
7 8 9 10
11 12 13 14

import java.util.Scanner;
class Ques4{
public static void main(String [] args){
Scanner input = new Scanner(System.in);
System.out.print("Enter number of rows =");
int rows = input.nextInt();
int val = 1;
for(int i = rows ; i >= 0 ; i--){
for(int j = rows ; j > i;j-- ){
System.out.print(val+ " ");
val = val +1;
}
System.out.println();
}
}
}

1
2 1
3 2 1
4 3 2 1
5 4 3 2 1

How to print the series
1
2 6
3 7 10
4 8 11 13
5 9 12 14 15

public class patternnumberexample15 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int count=1;
for(int i=1;i<=9;i+=2){
count=i;
for(int j=1;j<=9;j+=2){

if(count<=9){
System.out.print(count);
count=count+2;
}else{
count=1;
System.out.print(count);
count=count+2;
}
}
System.out.println();

}

}

}

This comment has been removed by the author.

using recursive method and not with loops

If n=3, make a pattern like this

--1
2 3 4
--5

if n=5

-----1
---2 3 4
-5 6 7 8 9
--10 11 12
-----13

INPUT:Enter any String of odd length:PHYSICS
OUTPUT SHOULD BE:
P
H
Y
P H Y S I C S
I
C
S
SIr plzz help me out!!!!

INPUT:Enter any String of odd length:PHYSICS
OUTPUT SHOULD BE:
P
H
Y
P H Y S I C S
I
C
S
SIr plzz help me out!!!!

This comment has been removed by the author.

It has a simple logic.
for(i=1;i<=5;i++)
{
for(j=i;j<=5;j++)
{
System.out.print(j+" ");
}
System.out.println();
}

2.Write a program to print the following triangle of numbers:

1
1 2
1 2 3
1 2 3 4
1 2 3 4 5

Sir, what would be the program for this?

3 4 6 8 9
12 15 16 18 20
21 24 27 28 30
32 33 36 39 40

Can you please solve this problem. That if 3 is provided the printed pattern would be

333
313
323
333

And for 5 it would be

55555
55155
55255
55355
55455
55555?

Can you please solve this problem. That if 3 is provided the printed pattern would be

333
313
323
333

And for 5 it would be

55555
55155
55255
55355
55455
55555?

This comment has been removed by the author.

How to display this output ?
1
2 3
4 5 6
7 8 9 10

How to display this output ?

1
2 3
4 5 6
7 8 9 10

How to print this pattern?
12345
6789
101112
1314
15

This comment has been removed by the author.

*****
***
**
*
**
***
*****
pls write the code above pattren

123
412
312

what will be the code for
aAbBcCdD
AaBbCc
aAbB
Aa

import java.util.*;
public class logicprogram {

public static void main(String[] args) {
String name="amit is a good boy";
String split[]=name.split(" ");
for(int i=0;i<4;i++){
for(int j=0;j<split.length;j++){
String charcut=split[j];
if(charcut.length()<=i)
System.out.print("*");
else
System.out.print(charcut.charAt(i));
}
System.out.println();
}

}

}

This comment has been removed by the author.

Can you please tell the code for this pattern sir??
Thanks Before

_________0
_______1 2 3
_____2 3 4 5 6
___3 4 5 6 7 8 9
4 5 6 7 8 9 10 11 12
___3 4 5 6 7 8 9
____2 3 4 5 6
______1 2 3
________0

5432*
543*1
54*21
5*321
*4321

1
321
54321
7654321
987654321

1
11
111
1111
11111
what is the code??

This comment has been removed by the author.

Hi I was wondering if you could show me how to program this including the words:
PatternA
1
12
123
1234
12345
123456

PatternB
123456
12345
1234
123
12
1

PatternC
1
21
321
4321
54321
654321

PatternD
123456
12345
1234
123
12
1

Thanks!

sir can u pls help me for dis pattern...

12345
12344
12335
12245
11345

sir can u pls help me for dis pattern...

12345
12344
12335
12245
11345

sir can u pls help me for dis pattern...

12345
12344
12335
12245
11345

how to print

*****
***
*
***
*****

code for the following:
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5

what will be code for
1234567

12345
123
1

This comment has been removed by the author.

---------1
--------1 1
-------1 2 1
------1 2 2 1
-----1 2 3 2 1
----1 2 3 3 2 1
---1 2 3 4 3 2 1

1
121
12321
121
1

1
121
12321
121
1

1
121
12321
121
1

what will be the program for the following pattern:
1
1 1
1 2 1
1 3 3 1

1
1 1
1 2 1
1 3 3 1

5
45
345
2345
12345

123
234
345
456
567
678
789
pls send the code for this

123456789
1234567
12345
123
1

Can u give program for
1
1 3
1 3 3 and

1
2 4
4 6 8 and

1
5 5
10 10 10

Can u give program for
1
1 3
1 3 3 and

1
2 4
4 6 8 and

1
5 5
10 10 10

55555
4444
333
22
1

send me the code for this pattern
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25

send me the code for this pattern
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25

Help me

ABCDE
ABCDA
ABCAB
ABABC
AABCD

Help me

ABCDE
ABCDA
ABCAB
ABABC
AABCD

class Pattren_tri
{
public static void main(String[] args)
{
int i,j,k;

for(i=1; i<=5; i++)
{
for(j=1; j<=i; j++)
{

System.out.print(j);
}
for(k=i; k>=1; k--)
{

System.out.print(k);

}

System.out.println();
}
}
}

1
2 3
4 5 6
7 8 9 10
11 12 13 14 15

please tell me the program to generate the series
1
2 1
3 2 1
4 3 2 1
5 4 3 2 1

1)
11111
2222
333
44
5

2)
5
44
333
2222
11111

Can u give the code for this pattern??
123456789
12345
123
1

Can u give the code for this pattern??
123456789
12345
123
1

Can u give the code for this pattern??
123456789
12345
123
1

Can u give the code for this pattern??
123456789
12345
123
1

Can u give the code for this pattern??
123456789
12345
123
1

Can u give the code for this pattern??
123456789
12345
123
1

What will be solution for this one?
1
11
202
3003

Plz give me this code

0-----0
1-----1
2-----2
3-----3
4-----0
5-----1
6-----2
7-----3
8-----0
9-----1
10-----2
11-----3
12-----0

This comment has been removed by the author.

for(int i=0;i<=12;i++)
System.out.println(i+"----"+(i%4));

1
3 2
6 5 4
10 9 8 7

what was the program for this pattern?
1
2 6
3 7 10
4 8 11 13
5 9 12 14 15

wap to draw a pattern
*****
* *
* *
*****

1
23
345
4567

Can u pls help me in

1
23
45

Can u pls help me in

1
23
45

Can u pls help me in

1
23
45

1
1 2
3 4 5
12 13 14 15
54 55 56 57 58

*******
*
*
*
* ****
* * *
* * *
*** *

can you please send me the code

! ! ! ! ! ! ! ! ! ! ! ! ! !
\\! ! ! ! ! ! ! ! ! !//
\\\\! ! ! ! ! !////
\\\\\\! !//////

HOW TO PRINT LIKE ABOVE ANY GUIDANCE PLEASE.
I GOT THIS IN MY INTERVIEW QUESTION. IF ANY BODY CAN SOLVE THIS THEN IT WILL BE MORE HELPFUL TO ME.
\\\\\\\\

kindly help with the coding for printing the following pattern
1 2 3 4 5 6 7 8 9
1 2 3 4 6 7 8 9
1 2 3 7 8 9
1 2 8 9
1 9
1 2 8 9
1 2 3 7 8 9
1 2 3 4 6 7 8 9
1 2 3 4 5 6 7 8 9

what will be the code for
1
11
21
1211
111221
312211
13112221
1113213211

55555
51115
52225
53335
54445
55555

thank u sir
same problem

How to print
1 1 1 1 1
1 2 2 2 1
1 2 3 2 1
1 2 2 2 1
1 1 1 1 1

It is the output when input is 3
I need a dynamic output
I have been trying this since a week.

******
***
*
***
*****

******
***
*
***
*****

Help me with this code for
123456789
12346789
123789
1289
19

Anonymous

can anyone help me for this pattern
1
2*3
4*5*6

can u plz send me this even no program
2 4 6 8 10
2 4 6 8
2 4 6
2 4
2
2 4
2 4 6
2 4 6 8
2 4 6 8 10

sir i want to know how to crack the following code
15.
14.10
13.09.06
12.08.05.03
11.07.04.02.01

How to print this pattern 5*5
1 2
3 4
5
6 7
8 9

1 2 3
6 5 4
7 8 9

class Sample
{
public static void main ( String arg[] )
{
int k=0;
int l=k;
int n=k;
for(int i =1;i<=4;i++)
{

for(int j=1;j<=4;j++)
{
if (i==1 )
{
k=k+1;
if(k==4)
{
k=2;

}
System.out.print(k+" ");

}
else if(i ==3)
{
l=l+1;
if(l==4)
{
l=2;

}
System.out.print(l+" ");
}
else if((i==2 || i ==4) && (j==1))
{
System.out.print(2+" ");
}
else if(i==2)
{
n = n+1;
System.out.print(n+" ");
}
else
{
n = n+1;
System.out.print(n+" ");
}

}
n=0;
System.out.println();
}
}
}

class Sample
{
public static void main ( String arg[] )
{
int k=0;
int l=k;
int n=k;
for(int i =1;i<=4;i++)
{

for(int j=1;j<=4;j++)
{
if (i==1 )
{
k=k+1;
if(k==4)
{
k=2;

}
System.out.print(k+" ");

}
else if(i ==3)
{
l=l+1;
if(l==4)
{
l=2;

}
System.out.print(l+" ");
}
else if((i==2 || i ==4) && (j==1))
{
System.out.print(2+" ");
}
else if(i==2)
{
n = n+1;
System.out.print(n+" ");
}
else
{
n = n+1;
System.out.print(n+" ");
}

}
n=0;
System.out.println();
}
}
}