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 :
Here are some common number patterns :
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.
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.
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.
1223 Comments Leave new
«Oldest ‹Older 1001 – 1200 of 1223 Newer› Newest»Hi ,can u plz help me out with this program?
ReplyA java program to print the series 3 3 4 8 10 30 33 upto n terms?
sir can u write java program for
Reply12345 54321
1234 4321
123 321
12 21
1 1
1 1
12 21
123 321
1234 4321
12345 54321
1
Reply2 6
3 7 10
4 8 11
5 9 12
Program for
Reply12345 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("");
}
}
}
Can you do this pattern please?
Reply*********
*********
*********
*********
class DEmo3
Reply{
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
Reply*********
*********
*********
*********
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("");
}
}
}
Sir can u please help me out with this problem
Reply7
14 15
28 29 30 31
56 57 58 59 60 61 62 63
print series for 7,10,8,11,9,12
Replyprint series for 7,10,8,11,9,12
ReplyProgram for
Reply7
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;
}
}
}
please help me with the following code
Reply1
2*3
4*5*6
7*8*9*10
4*5*6
2*3
1
10
Reply10 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
Reply10 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
Replyi/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
Reply4 4 4 4
4 4 4 4
4 4 4 4
4 4 4 4
Program for
Reply10
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
Reply4 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:
Reply1*2*3*4
9*10*11*12
13*14*15*16
5*6*7*8
Hello
Replyprivate 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
Reply1 2 3
4 5 6
7 8 9
output as
1 2 3
8 9 4
7 6 5
what will be the code from numbers pattern in triangle
Reply1
121
12321
1234321
Kindly please tell me the pattern of this code
Reply3
33
333
Sir please kindly tell me the code for this pattern
Reply3
333
3
123454321
Reply12344321
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)
Reply1######
12#####
123####
1234###
12345##
123456#
1234567
*****
Reply* *
* *
* *
* *
*****
sir give me this code pls....!
Please tell me how to create the pattern 123
Reply246
369 By the nested for loop
what is the code for this out put below?
Replylike this
NO Odd Numbers
1 1
2 1 3
3 1 3 5
Can you give me the code for
Reply1
1 2
1 2 3
1 2 3 4
Hi Arun,
ReplyHere'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:
Reply* *
* *
* *
*
* *
* *
* *
I want a program that counts the number of continuous alphabet and no. of vowel pairs.
ReplyFor 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
Reply2 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:
Reply1
12
123
1234
12345
1234
123
12
1
public class pattern
Reply{
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
Reply{
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();
}
}
}
please help to get codes fot the following pattern
Reply1
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
ReplyX Y
Y X Y
X Y X Y
Y X Y X Y
how to print this pattern:
Reply9 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:
Reply9 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
ReplyABCDEDCBA
ABCD*DCBA
ABC***CBA
AB*****BA
A*******A
AB*****BA
ABC***CBA
ABCD*DCBA
ABCDEDCBA
plzz code for this pattern
ReplyABCDEDCBA
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
Reply1
2 3
4 5 6
7 8 9 10
Sir give me code for the following pattern
Reply1
1 2
1 2 4
1 2 4 8
1 2 4 8 16...
Can you please help me to print this pattern
Reply1 2 3 4 5 6 7 8
1 2 3 4 5 6
1 2 3 4
1 2
Can you please help me to print this pattern
Reply1 2 3 4 5 6 7 8
1 2 3 4 5 6
1 2 3 4
1 2
Please help me of this pattern
Reply12345678
1234567
123456
12345
1234
how to print the program of
Reply1
31
531
7531
9753
How to create pattern :
Reply1 1
1 2 2 1
1 2 3 3 2 1
1 2 3 4 3 2 1
Simple for loop code please
can you please write a code for the following pattern using 2D array?
Reply0
1 2
3 4 5
6 7 8 9
please give me the code for
Reply1
21
321
4321
54321
12345678
Reply43218765
23456789
54329876
345678910
654310987
What will be the code for this patetrn:
Reply1
10
101
1010
10101
can U code this output I badly need it thanks!
Reply.....1
....21
...321
..4321
.54321
654321
how about
Reply- - - - 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
how about
Reply- - 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
ReplyPlease help me printing this pattern
ABCDEEDCBA
ABCD DCBA
ABC CBA
AB BA
A A
1
Reply1 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
ReplyPlease help me how to print this pattern
ABCDEEDCBA
ABCD--DCBA
ABC----CBA
AB------BA
A--------A
Two test cases are when I enter
Reply1) input-3
333
313
323
333
2)input-5
55555
55155
55255
55355
55455
55555
55555
Reply1111
555
11
5
Hi Please send code for below pattern
Replya
a b a
a b c b a
a b a
a
thanks
plz send this
Reply#
0 #
# 0 #
0 # 0 #
# 0 # 0 #
How can I make this program
Reply123454321
1234 4321
123 321
12 21
1 1
Sir what will be the code for
Reply321
21
1
Java code for this pattern..
Reply12345
12341
12312
12123
11234
public class Patterns
Reply{
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
Reply2 4
1 3 5
2 4 6 8
1 3 5 7 9
please solve this
HELLO I AM ANU AND I'D LIKE SOLUTION PROGRAM FOR GIVEN 2 PATTERNS
Reply1) 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
Please help with this pattern:::
ReplyIf(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
Reply1 1
22 22
333 333
4444 4444
55555 55555
Please can you help me with the code of this pattern 1
Reply1 2 1
1 2 4 2 1
1 2 4 16 4 2 1
Please help me in getting the out put as
ReplyNewYear-2017-1111
NewYear-2017-1112
Newyear-2017-1113
NewYear-2017-1114
NewYear-2017-1115
.
.
.
.
.
.
.
NewYear-2017-9999
Pattern for
Reply*****
*123*
*456*
*789*
*****
Pattern for
Reply*****
*123*
*456*
*789*
*****
Pattern for
Reply*****
*123*
*456*
*789*
*****
Pattern for
Reply*****
*123*
*456*
*789*
*****
what a complex & mathmetical logic bro... tell me honestly how you took to create this :P
Replyreally complex one bro, kudos for this.. tell me honestly, how much time you took to create this logic ??
ReplyHow to print the following ?
Replya
aba
abcba
aba
a
can u help me with this pattern
Reply1
2 4
3 5 7
6 8 10 12
how to print the pattern
Reply11
121
1331
14641
I need help with this...
Reply1******
12*****
123****
1234***
12345**
123456*
1234567
Could you please help me in this ?
1
Reply1 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
Reply1 1
2 3 5
8 13 21 34
solve this please
11
Reply12 22
13 23 33
14 24 34 44
15 25 35 45 55
What will be its coding
11
Reply12 22
13 23 33
14 24 34 44
15 25 35 45 55
What will be its coding
plz solve ths pattern to print..
Reply1
2 3
6 5 4
7 8 9 10
class DempPattern{
Replypublic 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{
Replypublic 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
ReplyHOW TO PRINT THIS
Reply1
2 3
4 5 6
7 8 9 10
11 12 13 14
please reply
here's your code:-
Replyimport 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();
}
}
}
please help to get this pattern..
Reply1
2 1
3 2 1
4 3 2 1
5 4 3 2 1
How to print the series
Reply1
2 6
3 7 10
4 8 11 13
5 9 12 14 15
public class patternnumberexample15 {
Replypublic 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();
}
}
}
using recursive method and not with loops
ReplyIf 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
ReplyOUTPUT 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
ReplyOUTPUT SHOULD BE:
P
H
Y
P H Y S I C S
I
C
S
SIr plzz help me out!!!!
It has a simple logic.
Replyfor(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:
Reply1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
*can you please help me
Sir, what would be the program for this?
Reply3 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
Reply333
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
Reply333
313
323
333
And for 5 it would be
55555
55155
55255
55355
55455
55555?
How to display this output ?
Reply1
2 3
4 5 6
7 8 9 10
How to display this output ?
Reply1
2 3
4 5 6
7 8 9 10
How to print this pattern?
Reply12345
6789
101112
1314
15
*****
Reply***
**
*
**
***
*****
pls write the code above pattren
123
Reply412
312
what will be the code for
ReplyaAbBcCdD
AaBbCc
aAbB
Aa
import java.util.*;
Replypublic 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();
}
}
}
Can you please tell the code for this pattern sir??
ReplyThanks 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*
Reply543*1
54*21
5*321
*4321
1
321
54321
7654321
987654321
1
Reply11
111
1111
11111
what is the code??
Hi I was wondering if you could show me how to program this including the words:
ReplyPatternA
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...
Reply12345
12344
12335
12245
11345
sir can u pls help me for dis pattern...
Reply12345
12344
12335
12245
11345
sir can u pls help me for dis pattern...
Reply12345
12344
12335
12245
11345
how to print
Reply*****
***
*
***
*****
Please tell me urgent
code for the following:
Reply1 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
Reply1234567
12345
123
1
please help me with this:
Reply---------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
Please give me the code for the following pattern, please!
Reply1
121
12321
121
1
Please give me the code for the following pattern, please!
Reply1
121
12321
121
1
Please give me the code for the following pattern, please!
Reply1
121
12321
121
1
what will be the program for the following pattern:
Reply1
1 1
1 2 1
1 3 3 1
can u please help me to solve this particular program:
Reply1
1 1
1 2 1
1 3 3 1
5
Reply45
345
2345
12345
123
Reply234
345
456
567
678
789
pls send the code for this
123456789
Reply1234567
12345
123
1
Can u give program for
Reply1
1 3
1 3 3 and
1
2 4
4 6 8 and
1
5 5
10 10 10
Can u give program for
Reply1
1 3
1 3 3 and
1
2 4
4 6 8 and
1
5 5
10 10 10
55555
Reply4444
333
22
1
send me the code for this pattern
Reply1 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
Reply1 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
ReplyABCDE
ABCDA
ABCAB
ABABC
AABCD
Help me
ReplyABCDE
ABCDA
ABCAB
ABABC
AABCD
class Pattren_tri
Reply{
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
Reply2 3
4 5 6
7 8 9 10
11 12 13 14 15
please tell me the program to generate the series
Reply1
2 1
3 2 1
4 3 2 1
5 4 3 2 1
Sir please help me with these two patterns
Reply1)
11111
2222
333
44
5
2)
5
44
333
2222
11111
Can u give the code for this pattern??
Reply123456789
12345
123
1
Can u give the code for this pattern??
Reply123456789
12345
123
1
Can u give the code for this pattern??
Reply123456789
12345
123
1
Can u give the code for this pattern??
Reply123456789
12345
123
1
Can u give the code for this pattern??
Reply123456789
12345
123
1
Can u give the code for this pattern??
Reply123456789
12345
123
1
What will be solution for this one?
Reply1
11
202
3003
Plz give me this code
Reply0-----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
for(int i=0;i<=12;i++)
ReplySystem.out.println(i+"----"+(i%4));
1
3 2
6 5 4
10 9 8 7
please
what was the program for this pattern?
Reply1
2 6
3 7 10
4 8 11 13
5 9 12 14 15
wap to draw a pattern
Reply*****
* *
* *
*****
1
Reply23
345
4567
Can u pls help me in
Reply1
23
45
Can u pls help me in
Reply1
23
45
Can u pls help me in
Reply1
23
45
1
Reply1 2
3 4 5
12 13 14 15
54 55 56 57 58
*******
Reply*
*
*
* ****
* * *
* * *
*** *
can you please send me the code
! ! ! ! ! ! ! ! ! ! ! ! ! !
Reply\\! ! ! ! ! ! ! ! ! !//
\\\\! ! ! ! ! !////
\\\\\\! !//////
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
Reply1 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
Reply1
11
21
1211
111221
312211
13112221
1113213211
55555
Reply51115
52225
53335
54445
55555
Please code for this pattern
thank u sir
Replysame problem
How to print
Reply1 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.
******
Reply***
*
***
*****
******
Reply***
*
***
*****
Help me with this code for
Reply123456789
12346789
123789
1289
19
can anyone help me for this pattern
Reply1
2*3
4*5*6
can u plz send me this even no program
Reply2 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
Reply15.
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
Plz reply me
Reply1 2 3
6 5 4
7 8 9
class Sample
Reply{
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
Reply{
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
Reply{
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();
}
}
}
Public class Piyush{
Replypublic static void main(String args[]){
For(int I=1;I<=5;I++){
System.out.print(I);
For(int j=I;j>=1;j---){
System.out.print(j);
}
System.out.println();
}
}
}
public static void main(String args[])
Reply{
int l = 1;
for(int i=1;i<=5;i++)
{
for(int z=1;z<=i;z++)
{
System.out.print(z);
}
if(i<5)
{
System.out.print(" ");
}
for(int x =l;x>=1;x--)
{
System.out.print(x);
}
l++;
System.out.println();
}
}
}
public static void main(String args[])
Reply{
int l = 1;
for(int i=1;i<=5;i++)
{
for(int z=1;z<=i;z++)
{
System.out.print(z);
}
if(i<5)
{
System.out.print(" ");
}
for(int x =l;x>=1;x--)
{
System.out.print(x);
}
l++;
System.out.println();
}
}
}
public static void main(String args[])
Reply{
int l = 1;
for(int i=1;i<=5;i++)
{
for(int z=1;z<=i;z++)
{
System.out.print(z);
}
if(i<5)
{
System.out.print(" ");
}
for(int x =l;x>=1;x--)
{
System.out.print(x);
}
l++;
System.out.println();
}
}
}
can you help me for this pattern
Reply1
121
12321
1234321
123454321
Make sure you tick the "Notify Me" box below the comment form to be notified of follow up comments and replies.