×
FREE ASSISTANCE FOR THE INQUISITIVE PEOPLE
Tutorial Topics
X
softetechnologies
What are classes and objects in java.
Write a programme to print the following pattern - Java
3777    Arnab De    16/06/2018

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

 

 

 

 

softetechnologies
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");
        }
    }
}

softetechnologies

Output
N P S
  N P S
    N P S
      N P S
        N P S
          N P S
What are classes and objects in java.
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.
Enter New Comment
Comment History
No Comment Found Yet.
Swami Vivekananda
You cannot believe in God until you believe in yourself.
Swami Vivekananda
2660
90.36
Today So Far
Total View (Lakh)
softetechnologies
26/05/2018     55449
25/06/2018     46541
01/01/2018     44509
28/06/2017     42236
02/08/2017     41373
01/08/2017     35212
06/07/2017     34982
15/05/2017     34108
11/09/2018     32217
14/07/2017     31238
softetechnologies