C Programming - Assignment 8
Assignment - 8
---------------------------
This assignment is based on nested loops. These questions are pattern based and will really improve your problem solving skills.
Write C Programs to generate the following patterns. One program for each of the below patterns. Hint : We will use nested loop concepts for solving all the pattern questions below.
Pattern : 1
--------------------------
* * * *
* * *
* *
*
Pattern: 2
--------------------------
* * * *
* * *
* *
*
Pattern: 3
--------------------------
*
* *
* * *
* * * *
Pattern: 4
--------------------------
*
* * *
* * * * *
Pattern: 5
--------------------------
*
* * *
* * * * *
* * *
*
Pattern 6:
--------------------------
* * * *
* * * *
* * * *
* * * *
* * * *
Pattern 7:
--------------------------
*
* *
* * *
* * * *
Pattern 8:
--------------------------
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*
Pattern 9:
--------------------------
* * * * *
* * *
*
Pattern 10:
--------------------------
* * * * *
* * *
*
* * *
* * * * *
Pattern 11:
--------------------------
*
* *
* *
* *
* *
* *
* *
* *
*
Pattern 12:
--------------------------
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Pattern 13:
--------------------------
0 0 0 0
1 1 1
0 0
1
Pattern 14:
--------------------------
0
1 1
0 0 0
1 1 1 1
Pattern 15:
--------------------------
4 3 2 1
3 2 1
2 1
1
Pattern 16:
--------------------------
1 2 3 4
1 2 3
1 2
1
Pattern 17:
--------------------------
0 1 0 1
0 1 0
1 0
1
Pattern 18:
--------------------------
1 2 3 4
2 3 4
3 4
4
Pattern 19:
--------------------------
4
4 3
4 3 2
4 3 2 1
Pattern 20:
--------------------------
A B C D
A B C
A B
A
Pattern 21:
--------------------------
D C B A
C B A
B A
A
Pattern 22:
--------------------------
A
B C
D E F
G H I J
Pattern 23:
--------------------------
A B C D
A B C
A B
A
Pattern 24:
-----------------------------
A B C D E F G F E D C B A
A B C D E F F E D C B A
A B C D E E D C B A
A B C D D C B A
A B C C B A
A B B A
A A
Comments
Post a Comment