Write a programme to print the following pattern
16-06-2018    122 times
pattern java

Write a programme to print the following pattern

N P S
  N P S
    N P S
      N P S
        N P S
          N P S

 

 

 

 

Tutorial at home
public class Pat2
{
    public static void main(String []args)
    {
        int r,c,n=6;
        for(r=1;r<=n;r++)
        {
            for(c=1;c<r;c++)
            {
                System.out.print(" ");
            }
            System.out.println("N P S");
        }
    }
}

Tutorial at home

Output
N P S
  N P S
    N P S
      N P S
        N P S
          N P S
softetechnologies
    Author Details
Arnab De
I have over 16 years of experience working as an IT professional, ranging from teaching at my own institute to being a computer faculty at different leading institute across Kolkata. I also work as a web developer and designer, having worked for renowned companies and brand. Through tutorialathome, I wish to share my years of knowledge with the readers.
    Related Post
  Query About the post