Exercise - Nested Loop

Try to generate the following series program using Nested Loop:

1
12
123
1234
12345
C C#
12345
1234
123
12
1
C
1
22
333
4444
55555
5 4 3 2 1
4 3 2 1
3 2 1
2 1
1
C
5 4 3 2 1
5 4 3 2
5 4 3
5 4
5
C
1
2  3
4  5  6
7  8  9  10
11 12 13 14 15
Fibonacci Triangle
1
1 1
1 1 2
1 1 2 3
     1
    12
   123
  1234
 12345
C
 12345
  1234
   123
    12
     1
     1
    121
   12321
  1234321
 123454321
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
C
          0
        1 0 1
      2 1 0 1 2
    3 2 1 0 1 2 3
  4 3 2 1 0 1 2 3 4
5 4 3 2 1 0 1 2 3 4 5
     1
    232
   34543
  4567654
 567898765
     1
    2 2
   3 3 3
  4 4 4 4
 5 5 5 5 5
*
* *
* * *
* * * *
* * * * *
C
* * * * *
* * * *
* * *
* *
*
     *
    * *
   * * *
  * * * *
 * * * * *
 * * * * *
  * * * *
   * * *
    * *
     *
    *
   * *
  * * *
   * *
    *
         *
       * * *
     * * * * *
   * * * * * * *
 * * * * * * * * *
* * * * *
 * * * *
  * * *
   * *
    *
   * *
  * * *
 * * * *
* * * * *
A
B C
D E F
G H I  J
K L M N O
P Q R  S T U
V W X Y Z A B
C D  E F G H I J
A B C D E
A B C D
A B C
A B
A
A
A B
A B C
A B C D
A B C D E
C Python
         A
       ABA
     ABCBA
   ABCDCBA
 ABCDEDCBA
ABCDEDCBA
ABCD DCBA
ABC   CBA
AB     BA
A       A
1234
5678
9012
3456
7890
1 1 1 1 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 1 1 1 1
C
- - - - -
+ - + - +
- + - + -
+ - + - +
- - - - -
C
  1. WAP to display multiplication table from 1 to 10. C
  2. WAP to find factorial of 1st 10 numbers.
  3. Print Prime number in a given range.
  4. Find composite numbers between 2 to 1000.
  5. WAP to find input number is Armstrong or not.
  6. Find sum of series: 1 + x + x2 + x3 + ... xn
  7. Find sum of series: c series program C
  8. Find sum of series: c series program
  9. Sin(x) = x – (x3 / 3!) + (x5 / 5! ) – (x7 / 7! ) + …
Advertisement


Advertisement