0% found this document useful (0 votes)
53 views

Nested Loop and Star Pattern Notes

1. The document describes generating nested loop and star patterns using for loops in C programming. 2. It provides examples of nested for loops to generate a numeric table and print star patterns in the form of a triangle, square, and diamond shape. 3. The code samples show how to use nested for loops with conditional statements to control the printing of numbers and stars in the desired patterns.

Uploaded by

kumarprakash0658
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)
53 views

Nested Loop and Star Pattern Notes

1. The document describes generating nested loop and star patterns using for loops in C programming. 2. It provides examples of nested for loops to generate a numeric table and print star patterns in the form of a triangle, square, and diamond shape. 3. The code samples show how to use nested for loops with conditional statements to control the printing of numbers and stars in the desired patterns.

Uploaded by

kumarprakash0658
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
You are on page 1/ 7

1

Nested loop and star pattern problems

Day-12

By
Saurabh Shukla
( My Sir a)
NestedLoop_
←5
while c)
for ( ; ; )
{

1
{
for C ; ; )←
{
for ( ; ;)
to {

É
}

, ,
write to
a
program generate table chart
.

3 4 5 6 7 8 9 10
I 2

18

for ( & =/ j É< =/


16 20

It -1 )
2 4 6 8 10 12 14
0
; 3 6 9 12 15 18 21 24 2730

16 20 24 28 3236 40
{
4 8 12

Jt -1)
25 30 35 40 4550

for
5 10 15 20

=\ ; < =/ 0 ; 6 12 18 za so
3642485460

35 42 49566370
7 14 21 28

{ a
8 16 24 3240 48 56 64 7280
" 6372 81 90

printfc"%d
9 18 27 3645 54

]# I 10 20 30 40 50 60 70 8090100

i
T 34 5678910
} 1 2

C' in ) ;
"

print -
2
3

9
starpalternCBasicskzeheato.in#jfooci--l;ia--6;i+①
+
¥-1
* * * * * *
, 2 # * *
§

%¥¥
3 * * * *

forcj-iiia-6.it" 4 * * *

{
ifcja -7--51 " "
);
print f- ( *

③ iii
else
pnhtfc
"
"

);
_ _


/
I 123456

}
I & < " "
1234
" ≤

, j<=6 3
1 23
4
"
5<=5
);
"
printf( In 2

3 j<=4
5 12

} 4
s
5<=3
j⇐z ⑤=z_ j
6 jail
Displacing pattern
*
* *
* * *

* * * *
* * * * * * *

* * * * *

* * *

*
I

12

1 23

1234

You might also like