Nested Loop in C++, Number Pattern & Star Pattern

Nested Loop 

जब किसी looping statement के अंदर अन्य loop statement define किया जाता है, ऐसे Looping statement को Nested Loop कहा जाता है | 

Syntax:

for(... ; ... ; ...)

{

    for(... ; ... ; ...)

    {

        ............... ;

        ............... ;

    }

}

* Program to print following series -

3    6    9    2    4    6    12    15    18    8    10    12    .    .    .    .    .
















* Program to print following Number Pattern -

1
23
456
78910


* Program to print following Number Pattern -

1
22
333
4444
55555










* Program to print following Number Pattern -

        1
      22
    333
  4444
55555

* Program to print following Number Pattern -

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

* Program to print following Number Pattern -

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


* Program to print following Star Pattern -

* * * * *
  * * * *
   * * *
    * *
     *
    * *
   * * *
  * * * *
* * * * *





























* Program to print following Star Pattern -

        *
      ***
    *****
  *******
*********
  *******
    *****
      ***
        *































* Program to print following Star Pattern -

**********
****    ****
***        ***
**            **
*                *
**            **
***        ***
****    ****
**********







टिप्पणियाँ

इस ब्लॉग से लोकप्रिय पोस्ट

Introduction to Programming

Procedure & Flow Chart

File Extensions & Data Types