×
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
3108    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.
Albert Einstein
Education is not the learning of facts, but the training of the mind to think.
Albert Einstein
1570
63.24
Today So Far
Total View (Lakh)
softetechnologies
26/05/2018     46570
25/06/2018     38722
01/01/2018     38403
28/06/2017     36333
02/08/2017     35037
01/08/2017     29311
06/07/2017     29067
15/05/2017     28596
14/07/2017     24426
11/09/2018     23459
softetechnologies