0% found this document useful (0 votes)
95 views3 pages

Pattern Assignment 1 1 PDF

The document contains examples of nested loops with increasing levels of nesting from 1 to 5. Each example prints the numbers from 1 to N in a nested pattern, with increasing indentation to show deeper levels of nesting. Additional examples show variations like printing numbers in reverse order or different nested patterns. Links are provided for additional practice on looping structures.

Uploaded by

Jagdeep Pandey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views3 pages

Pattern Assignment 1 1 PDF

The document contains examples of nested loops with increasing levels of nesting from 1 to 5. Each example prints the numbers from 1 to N in a nested pattern, with increasing indentation to show deeper levels of nesting. Additional examples show variations like printing numbers in reverse order or different nested patterns. Links are provided for additional practice on looping structures.

Uploaded by

Jagdeep Pandey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

NOTE : Colors indicate nested loops

N=5 N=5 N=5

1 1 5 4 3 2 1
1 2 2 1 5 4 3 2
1 2 3 3 2 1 5 4 3
1 2 3 4 4 3 2 1 5 4
1 2 3 4 5 5 4 3 2 1 5

N=5 N=5

1 1
1 2 2 2
1 2 3 3 3 3
1 2 3 4 4 4 4 4
1 2 3 4 5 5 5 5 5 5

N=5 N=5

0 1
1 0 1 0
0 1 0 1 0 1
1 0 1 0 1 0 1 0
0 1 0 1 0 1 0 1 0 1
N=5 N=5

1 1
2 2 2 2 1 2
3 3 3 3 3 3 2 1 2 3
4 4 4 4 4 4 4 4 3 2 1 2 3 4
5 5 5 5 5 5 5 5 5 4 3 2 1 2 3 4 5

N=5
N=5
1
1 0 1 5 4 3 2 1 2 3 4 5
1 0 1 0 1 5 4 3 2 2 3 4 5
1 0 1 0 1 0 1 5 4 3 3 4 5
1 0 1 0 1 0 1 0 5 4 4 5
5 5

N=5

5 5 5 5 5 5 5 5
4 4 4 4 4 4 4
3 3 3 3 3
2 2 2
1

N=5 N=5
5 4 3 2 1 2 3 4 5 5 5 5 5 5 5 5 5
5 4 3 2 2 3 4 4 4 4 4 4 4 4 4
5 4 3 3 4 3 3 3 3 3 3
5 4 4 2 2 2 2
5 1 1
5 1 1
5 4 4 2 2 2 2
5 4 3 3 4 3 3 3 3 3 3
5 4 3 2 2 3 4 4 4 4 4 4 4 4 4
5 4 3 2 1 2 3 4 5 5 5 5 5 5 5 5 5

Please refer these links for additional practise on looping structures.

[Link]
[Link]

Rohit Ahuja
Vedisoft Software & Education Services Pvt. Ltd.
Mobile : 9893075987

You might also like