Welcome to ICSE Java Answers. Ask any questions you have related to Java and we will answer them.
Java is a registered trademark of Oracle. This site is in no way related to or endorsed by Oracle.

Print pattern - 1234567* 123456*8 12345*78 1234*678 123*5678 12*45678 1*345678 *2345678

0 votes
1  2  3  4  5  6  7  *

1  2  3  4  5  6  *  8

1  2  3  4  5  *  7  8

1  2  3  4  *  6  7  8

1  2  3  *  5  6  7  8

1  2  *  4  5  6  7  8

1  *  3  4  5  6  7  8

*  2  3  4  5  6  7  8
asked by YASH
edited by Ranjith

1 Answer

0 votes
 
Best answer
// Tested on BLUEJ Environment
class PatternNet
{
    void main()
    {
        for(int i = 8; i >= 1 ; i--)
        {
            for(int j = 1; j <= 8 ; j++)
            {
                if(j == i)
                    System.out.print("* ");
                else
                    System.out.print(j+" ");
            }
            System.out.println();
        }
    }
}
answered by Navs
...