where N is a positive integer
(ii) To print the following triangle with N rows Example: If N = 5. Output:
15
14 13
12 11 10
9 8 7 6
5 4 3 2 1
Answers
Answered by
0
Answer:
Explanation:
Given a positive integer n. The problem is to print the pyramid pattern as described in the examples below. Examples: Input : n = 4 Output : 1 3*2 4*5*6 10*9*8*7 Input : n = 5 Output : 1 3*2 4*5*6 10*9*8*7 ... for ( int i=1; i<=n; i++). {. // if row number is odd. if (i%2 != 0). {. // print numbers with the '*' sign in.
Similar questions
Social Sciences,
3 months ago
Math,
6 months ago
Math,
6 months ago
Computer Science,
10 months ago
Hindi,
10 months ago