Advertisements

Aatul Palandurkar

Posts Tagged ‘Aatul Palandurkar

Q. Write a Java program to print given pattern.

Pattern 1 :

1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4 5 6
1 2 3 4 5 6 7

 

Java Program:


import java.util.Scanner;

public class MainClass

{

public static void main(String[] args)

{

Scanner sc = new Scanner(System.in);

//Taking rows value from the user

System.out.println("How many rows you want in this pattern?");

int rows = sc.nextInt();

System.out.println("Here is your pattern....!!!");

for (int i = 1; i <= rows; i++)

{

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

{

System.out.print(j+" ");

}

System.out.println();

}

//Close the resources

sc.close();

}

}

Advertisements

Glimpse of Stress Management Seminar by Aatul Palandurkar at Samarth Ramdas High School and Junior College, Aroli, Dist. Nagpur

Thanks a lot to Principal Nanda Kumbhalkar Mam and Management for the invitation, it was a great experience to visit the campus.

Regards

Aatul Palandurkar

Life Coach, International Trainer and Author

http://aatulpalandurkar.com

http://aatul.me (Tech Blog)

https://www.facebook.com/aatulpalandu…

https://www.instagram.com/aatulpaland…

https://twitter.com/AtulPalandurkar

Hey friends, repeat these 10 affirmations daily and see the miracle, you will get success in every walk of life.


Advertisements

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 14,537 other followers

Tweets

YouTube

Advertisements
%d bloggers like this: