Program to Print Triangle Pattern in java

Program to Print Triangle Pattern in java

Printing various patterns in any programming language gives a good start to that language, by printing those patterns we can practice more and its also an important tool to judge your loop knowledge! So today we will learn how to make triangle patterns in JAVA. Many interesting triangle patterns can be made using programming, but in this post I will show you how to make equilateral triangle pattern using Java Language.

1. Lets create a perfect triangle, for that here's a java program source code:

import java.io.*;
public class triangle {
    public static void main ( String arg[] ){
        InputStreamReader istream = new InputStreamReader(System.in) ;
        BufferedReader read = new BufferedReader(istream) ;
        System.out.print("Enter Triangle Size : ");
        int num=0;
        try{
            num=Integer.parseInt( read.readLine() );
        } catch(Exception Number){
            System.out.println("Invalid Number!");
        }
            for(int i=1;i<=num;i++){
                for(int j=1;j<num-(i-1);j++){
                    System.out.print(" ");
                }
                for(int k=1;k<=i;k++){
                    System.out.print("*");
                    for(int k1=1;k1<k;k1+=k){

                        System.out.print("*");
                    }
                }
                System.out.println();
            }
    }
}

Output of the above program :
Equilateral triangle pattern in Java

2. Now lets create an upside down triangle and to do so, Here's the code :
import java.io.*;
public class triangle {
    public static void main ( String arg[] ){
        InputStreamReader istream = new InputStreamReader(System.in) ;
        BufferedReader read = new BufferedReader(istream) ;
        System.out.print("Enter Triangle Size : ");
        int num=0;
        try{
            num=Integer.parseInt( read.readLine() );
        } catch(Exception Number){
            System.out.println("Invalid Number!");       
            for(int i=1;i<=num;i++){
                for(int j=i;j>1;j--){
                    System.out.print(" ");
                }
                for(int k=1;k<=num-(i-1);k++){
                    System.out.print("*");
                    for(int k1=1;k1<k;k1+=k){
                        System.out.print("*");
                    }
                }
                System.out.println();          
    }
}
Output of the above program :
Upside Down Triangle Pattern in Java


Now lets do the same thing in a  different way

3. Perfect triangle made by placing blank spaces, Here's the code :

import java.io.*;
public class triangle {
    public static void main ( String arg[] ){
        InputStreamReader istream = new InputStreamReader(System.in) ;
        BufferedReader read = new BufferedReader(istream) ;
        System.out.print("Enter Triangle Size : ");
        int num=0;
        try{
            num=Integer.parseInt( read.readLine() );
        } catch(Exception Number){
            System.out.println("Invalid Number!");
        }
            for(int i=1;i<=num;i++){
                for(int j=1;j<=num-(i-1);j++){
                    System.out.print("*");
                    if(j==num-(i-1)){
                        for(int k=1;k<=i;k+=1){
                            System.out.print(" ");
                        }
                        for(int s=1;s<i;s++){
                            System.out.print(" ");
                        }
                        for(int l=1;l<=num-(i-1);l++){
                            System.out.print("*");
                        }
                    }
                }
                System.out.println();
            }
    }
}

Output of the above program : 
Blank Space Equilateral Triangle pattern inJava

4. Upside down triangle made by placing blank spaces, Here's the code :

import java.io.*;
public class triangle4 {
    public static void main ( String arg[] ){
        InputStreamReader istream = new InputStreamReader(System.in) ;
        BufferedReader read = new BufferedReader(istream) ;
        System.out.print("Enter Triangle Size : ");
        int num=0;
        try{
            num=Integer.parseInt( read.readLine() );
        } catch(Exception Number){
            System.out.println("Invalid Number!");
        }
            for(int i=1;i<=num;i++){
                for(int j=num-i;j<num;j++){
                    System.out.print("*");
                    if(j==num-1){
                        for(int k=i;k<=j+1;k+=1){
                            System.out.print(" ");
                        }
                        for(int s=1;s<num-(i-1);s++){
                            System.out.print(" ");
                        }
                        for(int l=num-i;l<num;l++){
                            System.out.print("*");
                        }
                    }              
                System.out.println();
            }
    }
}
Output of the above program : 
Blank Space Upside down triangle pattern in Java

You can create triangle of any size ( size here means number of lines ) using these codes.
Various patterns can be printed in Java for more such interesting patterns keep watching the blog!


354 Comments Leave new

«Oldest   ‹Older   201 – 354 of 354   Newer›   Newest»

Please provide code for this:
#
##
###
####
#####
######

Reply

sir i need code for the following program.please help me out
1
765
2
12345
3
1098765


Reply

Hi Sir, please give me code for this output
1 2 3 4 5
5 4 3 2
2 3 4
4 3
3

Reply
This comment has been removed by the author.

can you provide code for triangle with only borders an empty inside.

*
* *
* *
* *
* *

Reply

for(int i=1;i<n;i++)
{
for(int j=1;j<i;j++)
{
int space++;
System.out.println(space + " '");
}
]

Reply

Plz provide code for it
----1
---1 2
--1 2 3
-1 2 3 4
1 2 3 4 5

Reply
This comment has been removed by the author.

sorry. this:
b***b
*l**l*
**u**
*e**e*
j***j

* indicates space

Reply

code explain the important of forloop but i can't understand the concept so please explain how to derive code?

Reply

Can We create single link list and double link list program in java ?

Reply

Please can any one produce that output:

1
3 5
7 9 11
13 15 17 19

Reply

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

Reply

help me please:
ouput: using 3 for loops
xoxoxoxoxo
oxoxoxoxox
xoxoxoxoxo
oxoxoxoxox
xoxoxoxoxo

Reply

How do i create a program that prints a triangle like this
5
45
345
2345
12345
with it taking an imput of 5 to create this output.

Reply

How do i create a program that prints a triangle like this
5
45
345
2345
12345
with it taking an imput of 5 to create this output.

Reply

Code for this output :
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1

help me sir....

Reply

pleasss solve this patten


4 5 6 7 8 9
9 13 17
22 17
39

Reply

Hello sir, i want to print string pattern and string is given as per user input. for example input string is "java ". we have to print like this
j
j a
j a v
j a v a

Reply

can you help me please..i want build program the following triangle of numbers like this
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5

Reply

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

please help!! :(

Reply

*
* *
* * *
* * * *
plz generate a code for me.

Reply
This comment has been removed by the author.

import java.util.Scanner ;

public class NameStar {

public static void main (String[] args) {

int i , j , y ;


Scanner in = new Scanner (System.in);

y = in.nextInt();


space = y ;

for ( i = y ; i >= 1 ; --i){

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


System.out.print( "*" );

}
System.out.println();
}
}
}

Reply

how to print this ? i've try my best but i still can't get it .

****FIK
***FIKFIK
**FIKFIKFIK
*FIKFIKFIKFIK

Reply

sir can you please help me with this pattern
5
54
543
5432
54321

Reply

sir can you please help me with this pattern
5
54
543
5432
54321

Reply

sir can you please help me with this pattern
5
54
543
5432
54321

Reply

Can i get help how to do this
*
**
***
****
*****

Reply

Can i get help how to do this
*
**
***
****
*****

Reply

Can you do this with do while loops
user input: (any number)

example output
Input: 3

Output:
*
**
***
**
*

Reply

Can you do this with do while loops
user input: (any number)

example output
Input: 3

Output:
*
**
***
**
*

Reply

Pls give me a code for this
1
1 2
1 2 5
1 2 5 12
1 2 5 12 29
1 2 5 12 29 70

Reply

please send me java script for google map for my web application.

Reply

Hi there, I also have a problem like this one, but it's a little bit different. I need to have this output after an INPUT of any letter.

I need it to be in PHP script.

Enter a letter: E

so this must be the output if letter E is entered.

________________A
_______________ABA
______________ABCBA
_____________ABCDCBA
____________ABCDEDCBA

if letter F is entered it must be like this and so on.

________________A
_______________ABA
______________ABCBA
_____________ABCDCBA
____________ABCDEDCBA
___________ABCDEFEDCBA

P.S
(_)underscore are spaces. i just need to put it that way to type it faster. LOL

Reply
This comment has been removed by the author.

I have got four programs.
A. A
A B C
A B C D E
A B C D E F G

B. A B C D E D C B A
A B C D D C B A
A B C C B A
A B B A
A A

C. 123456789
2345678
34567
456
5
456
34567
2345678
123456789

D.
2. 1234554321
1234---4321
123------321
12---------21
1------------1
12---------21
123------321
1234---4321
1234554321

Thank you for your effort and time :)

Reply

help me with this pattern
* * * * *
* * * *
* * *
* *
*

Reply

can you please help me to print this pattern.......
1
3 3
5 5 5
7 7 7 7

Reply

can you please help me to print this pattern.......
1
3 3
5 5 5
7 7 7 7

Reply

import java.util.Scanner;

class FloydTriangle
{
public static void main(String args[])
{
int n, num = 1, c, d;
Scanner in = new Scanner(System.in);

System.out.println("Enter the number of rows of floyd's triangle you want");
n = in.nextInt();

System.out.println("Floyd's triangle :-");

for ( c = 1 ; c <= n ; c++ )
{
for ( d = 1 ; d <= c ; d++ )
{
System.out.print(num+" ");
num++;
}

System.out.println();
}
}
}

Reply

can any one help me code for bellow pattern
1 2 3
8 9 4
7 6 5

Reply

can any one help me for bellow pattern
1 2 3
8 9 4
7 6 5

Reply

Please give me a Java code WAP to display Triangular numbers till n. A Triangular number is formed by the addition of consecutive integers starting from 1.

Example : 1 + 2 = 3
1 + 2 + 3 = 6
1 + 2 + 3 + 4 = 10
Hence the triangular nos are 3,6,10,….

Reply

0
000
00000
0000000
00000
000
0
Please if you know that problem tell me.

Reply
This comment has been removed by the author.

Can you help me for this pattern
******
** **
** **
******

Reply

Hi, can you help me solve this pattern please?

Given an integer N print the numeric pattern. Example:


N = 5

1 1
12 21
123321
12 21
1 1


N = 6

1 1
12 21
123321
123321
12 21
1 1


N = 7

1 1
12 21
123 321
12344321
123 321
12 21
1 1

and so on. Hope you can help! Thank you

Reply

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

Reply

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

how about this pattern?

Reply

Can u help me for this.
Your program should display the types of Triangle:
1-Acute Triangle,
2-Right Triangle, and
3-Obtuse Triangle

Sample Run:
Enter type of triangle: 1
0 0 0 * 0
0 0 * 0 0
0 * 0 0 0
* * * * *
Enter type of triangle: 2
0 0 0 0 *
0 0 0 0 *
0 0 0 0 *
* * * * *
Enter type of triangle: 3
0 0 0 0 0
* 0 0 0 0
0 * 0 0 0
0 0 * * *

Reply

Can u please explain me how this for loop works(used in the above program)???
How both i & k works??(As i'm newbie in java)
for( int i=1 , k=0 ; i<=5 ; i++ , k++ )

Reply

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

Reply

sir,can u help me to print the following series
1)1,5,13,29,49,77,...
2)2,3,5,11,23,29,41,53,83,89,..
3)8,6,23,87,429..

Reply

hai can u help me in printing 10 different name using string , scanner and for loop

Reply

hai can you help me in printing 10 different name using string , scanner and for loop

Reply

hie, The Series is program is,,,,,,,,,,,,,,,,

import java.util.*;
class Pattern
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter the line no.");
int n=sc.nextInt( );
int i,j,s=0;
for (i=1;i<=n;i++)
{
for (j=1;j<=i;j++);
{
s++;
if (s%2==0)
System.out.print("0");
else
System.out.print("1");
}
System.out.println();
}
}
}

Reply

1 2 3 4 5
6 7 8
9
10 11 12
13 14 15 16 17
Please help for this pattern

Reply

1 2 3 4 5
6 7 8
9
10 11 12
13 14 15 16 17
Please help for this pattern

Reply

Hello. I was given the problem of outputting asterisks in the following shape:

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

-The instructor also said she would have as "do an explanation" of our program so I would also like to have a detailed explanation of how the code works (I suspect she will ask us what is the sequence of operation of the loop) either attached to the post or sent to me by e-mail at [email protected] if possible. And please inform should anything prevent you from giving me whichever wither the solution or explanation and I will do all I can to do what I need in order to get that code. Thank you!

P.S. Got a sample code from you that would've saved me if the instructor had made it a quiz (when I got to class next day after finding code, I we were told it was just practice and that the above problem was the real homework). Pretty impressive site you have here: all that code for free and such quick replies to questions! This really is a Code Nirvana. I like it. Should I discreetly share about this site to others who need codes?

Reply

I need to elaborate on the result. somehow, the asterisks appear closer to each other in the above text box than they should be. The pattern is nine asterisks top row, 8 asterisks(4 on each side, 1 space in between) second row, 6 asterisks third row(three on each side, 3 spaces in the middle), and so on until there are two asterisks with on the left and one on the right side. The pattern is then mirrored. Replacing the space with a "-", the pattern would be:
*********
****-****
***---***
**-----**
*-------*
**-----**
***---***
****-****
*********

Thank you sirs.

Reply

* * *
* *
*
wap to dispaly this outupt in java ? any 1

Reply

for( int i=1 , k=0 ; i<=5 ; i++ , k++ ){}
please explain me the working of this line..\

Reply

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
for(int i=5;i>=0;i--)
{
for(int j=5;j>= i*-1;j--)
{
if(j<=i && j>=i*-1)
System.out.print("*");
else
System.out.print(" ");
}
System.out.println("");
}
}
}

Reply

sir,can u tell me the help me for the logic of the below pattern
when the number of rows is given as 4,it should print like:
1
2 3
4 5 6
7 8 9 10
7 8 9 10
4 5 6
2 3
1

Reply

Sir can you please help me to find out this program
#
*#*
**#**
***#***

Reply

Sir can you please help me to find out this program
#
*#*
**#**
***#***

Reply

can anyone please tell me the code for the below pattern
*
**
***
****
*****

Reply

i wanna code for this output
*****
****
***
**
*

Reply

2
2 2
2 4 2
2 8 6 2
2 10 12 8 2
please givw the logic

Reply

1
2 3
6 5 4
7 8 9 10
14 13 12 11,i need code for this

Reply

1
2 3
6 5 4
7 8 9 10
14 13 12 11,i need code for this

Reply

class loafer
{
public static void main(String agrs[])
{
for(int i=1;i<=4;i++)
{
for(int j=1;j<=i;j++)
{
if(j==1&&i==1)
{
System.out.println("@");
}
else if(j==2&&i==2)
{
System.out.println("@*@");
}
else if(j==3&&i==3)
{
System.out.println("@*@*@");
}
else if(j==4&&i==4)
{
System.out.println("@*@*@*@");
}
}
}
}
}

Reply

class loafer
{
public static void main(String agrs[])
{
for(int i=1;i<=4;i++)
{
for(int j=1;j<=i;j++)
{
if(j==1&&i==1)
{
System.out.println("@");
}
else if(j==2&&i==2)
{
System.out.println("@*@");
}
else if(j==3&&i==3)
{
System.out.println("@*@*@");
}
else if(j==4&&i==4)
{
System.out.println("@*@*@*@");
}
}
}
}
}

Reply

class loafer
{
public static void main(String agrs[])
{
for(int i=1;i<=4;i++)
{
for(int j=1;j<=i;j++)
{
if(j==1&&i==1)
{
System.out.println("@");
}
else if(j==2&&i==2)
{
System.out.println("@*@");
}
else if(j==3&&i==3)
{
System.out.println("@*@*@");
}
else if(j==4&&i==4)
{
System.out.println("@*@*@*@");
}
}
}
}
}

Reply

Sir, Plz help me

10001
0 0
0 0
0 0
10001

Reply

Hi...
The triangle pattern coding was the helpful...
Could you please help me by merging codes 3&4

Reply

write a program to display the following pattern.

__*
_*_*
*___*
_*_*
__*

please give me the loop code please.
thanks in advance.

Reply

write a program to display the following pattern.

__*
_*_*
*___*
_*_*
__*

please give me the loop code please.
thanks in advance.

Reply

write a program to display the following pattern.

__*
_*_*
*___*
_*_*
__*

please give me the loop code please.
thanks in advance.

Reply

public class Pattern {

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

Reply
This comment has been removed by the author.

How to remove duplicate characters from String with out using build function?

Reply

Give me the code of this pattern,if any one know
*
* *
* * *
* * * *

Reply

please tell this pattern
C
C O
C O M
C O M P
C O M P U
C O M P U T
C O M P U T E
C O M P U T E R


PLEASEEEEEEEEEEEEEE!!!

Reply

Need the code of this pattern ?

Two triangle side by side....

Reply

Need the code of this pattern ?

Two triangle side by side....

Reply

____*_______*____
___***____***_____
_*****__*****_____
**************_____

Need the code for the above pattern please....

Reply

hello sir,
i want to print a robot shape as follows
-------
| 0 0 |
|
___
|
/|\
|
|
/|\

Could you please help me in writing code for this shape

Thanks in advance

Reply

hello sir,
i want to print a robot shape as follows
-------
| 0 0 |
|
___
|
/|\
|
|
/|\

Could you please help me in writing code for this shape

Thanks in advance

Reply

sir can u pls help for this pattern
* * * * * *
* welcome *
* to *
* banglr *
* * * * * *

Reply

I want the following pattern
a
b
c
d
e

Reply

Hi Sir,

Can you please give me the code for the pattern
----------------11
-------------11 10 11
----------11 10 9 10 11
-------11 10 9 8 9 10 11

please can you help to the earliest possible. It would be great help Sir.

Thanks in advance.

Reply

4 3 2 1
4 3 2
4 3
4
4 3
4 3 2
4 3 2 1
sir help do while outer loop ,,for loop inner loop

Reply

Code Nirvana Sir I want a program which will print this series :-
1 11 22 33 44 55 66 .....n

Reply

I want a program which will print the following series:-
1 11 22 33 44 55 66 ...nn
. please mail this program to :- [email protected]

Reply

*
* *
* * *
* * * *
how to print this output ...........
please help me............

Reply

input : computer
output: co*mp*ut*er*
how to write the code for this type of program

Reply

Hi, I have conceived an alg for this pyramid pattern some time ago and i can't figure out the logic anymore, so please someone explain to me my own work :) Here goes the code:

char star = '*';
char[] starsArray = new char[21];
int size = starsArray.length;

for (int i = 0;i < size;i++){
starsArray[i] = star;
for (int j = 0;j <= i;j++){
System.out.print(starsArray[(size - j + i ) / 2 ]);
}
System.out.println();
}
System.out.println();

The pyramid pattern starts with one star at the top if (size % 2 = 1) and with two stars if (size % 2 = 0).

Reply

Hi could you help me to figure out the code for this:
1
123
12345
123
1
for odd number
now for even number:
1
123
123
1
Diamond shaped

Reply

hi Pankaj, can you please make a code fo this one ? i really need your help

3
3 3
3 3 3
3 3 3 3

Reply

1) 1
11
121
1331
14641
2)
1
31
531
7531
97531
97531
3)
@
@@@
@@@@@

4)
*
***
*****
***
*

Reply

sir wanna java code for this

9 9 9 9 9 9 9 9 9
7 7 7 7 7 7 7
5 5 5 5 5
3 3 3
1

Reply

Sir need a java code for this pattern

9 9 9 9 9 9 9 9 9
7 7 7 7 7 7 7
5 5 5 5 5
3 3 3
1

Reply

how to print ?
1
21
321
4321
54321

Reply

how to print ?
1
21
321
4321
54321

Reply

please can u jst give the function to this...
1
01
101
0101
10101

Reply

123
8 4
765

and

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

and
For Input-4
01
02 03
04 05 06
07 08 09 10
06 05 04
03 02
01

Reply

how to print
1
3 8 5
7 9 40 11 13

Reply

1
3 2 4
5 6 7 8 9
4 2 3
1
Plz sir reply this patin

Reply

1
3 2 4
5 6 7 8 9
4 2 3
1
Plz sir reply this patin

Reply

1
1 2
1 2 5
1 2 5 10
1 2 5 10 17

Reply

java program to print factorial of given n numbers using recursion

Reply

java program to find the largest and smallest number in an array

Reply

Here is the list of all the programs :
1. Automorphic numbers within a range
2. Neon numbers within a range
3. Special numbers within a range
4. Twin Prime series within a range
5. Unique numbers within a range
6. Duck numbers within a range
7. Disarium numbers within a range
8. Pronic numbers within range
9. Harshad numbers within a range
10. QuickSort Program
11. Twisted Prime Numbers within a range
12. Sum of series - 1*1+2*2+3*3_________upto n terms
13. Sum of series - 1*1+2*2+3*3*3+4*4*4________upto n terms
14. Sum of series - 1-(1+2)-(1+2+3)_____________upto n terms
15. Commission of salesman

Sorry for the long list of programs but these are all the programs i need right now.
All using Scanner class without any functions and methods.
Yours faithfully,
Anugrah Kapoor

Reply

can you help me with this?
1
4 9 16
25 36 49 64 81

Reply

hello !
If I type 9
out put are
1 3
2
4 6
5
7 9
8

Reply

1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
hw to do is rply fast plzzzzz

Reply

input:1591
output:
*
*****
*********
*

Reply
This comment has been removed by the author.

if i want to print the pattern COMPUTER
COMPUTE
COMPUT
COMPU
COMP
COM
CO
C
IF U CAN FIND A WAY PLEASE HELP ME !!

Reply

if i want to print the pattern COMPUTER
COMPUTE
COMPUT
COMPU
COMP
COM
CO
C
IF U CAN FIND A WAY PLEASE HELP ME !!

Reply

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

can you help me to this sir..

Reply

B
BA
BAN
......
........
BANGLADESH
Can you please do a pattern of a string using C source code? Like :

Reply

Can you help me with this program:
1. Write a java program that will print out following pattern.

5

4 5

3 4 5

2 3 4 5

1 2 3 4 5

Reply

Q6 WAp in java which display the following pattern

I
C C
S S S
E E E E

Reply
This comment has been removed by the author.

please help me to solve following pattern...

*
--*
*--*
--*--*
*--*--*
--*--*
*--*
--*
*

Reply

Can anyone help me print this code?:

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


Thank you

Reply
This comment has been removed by the author.

Hi I need help making a code that can print this out:
*
**
***
****
*****
Can anyone help me out pls

Reply
This comment has been removed by the author.

the opposite of that as in from the right side to the left side pls

Reply

Thankuu soo much but please kindly tell me the pattern of
3
33
333
and
3
333
3 also

Reply

anybody can help me with the operating system scheduling question ??

Reply

sir can u help me with the operating system scheduling question ?

Reply

Plz... Help me...
Print the pattern..
5
55
555
5555

Reply

Please tell me java code for this:
*********
**** ****
*** ***
** **
* *

Reply

can someone help with this output
x
xkx
xkxk
xkxkx
xkxkxk

Reply

code for this pattern
1
2 4 6
3 5 7 9 11

Reply

A
A B C
A B C D
A B C D E
This is the pattern please help me print it.

Reply

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

Please Give The Write Answers

Reply
This comment has been removed by the author.

Generate the following pattern for an input say 1110111 where equal
number of 1's can be prefixed and suffixed where 0 must be at the middle
position.

Reply

Generate the following pattern for an input say 1110111 where equal
number of 1's can be prefixed and suffixed where 0 must be at the middle
position.

Reply
«Oldest   ‹Older   201 – 354 of 354   Newer›   Newest»

Make sure you tick the "Notify Me" box below the comment form to be notified of follow up comments and replies.