Print the following patterns for a given N number of rows.
Pattern - 1
Note: There are no spaces.
For N = 4
Input format :
Output format :
Sample Input:
Sample Output:
Pattern - 2
For N = 5
Input format :
Output format :
Sample Input:
Sample Output:
Pattern - 3
For N = 4
Input format :
Output format :
Sample Input :
Sample Output :
Pattern - 4
For N = 4
Input format :
Output format :
Sample Input:
Sample Output:
Pattern - 5
For N = 3
Input format :
Output format :
Sample Input:
Sample Output:
Pattern - 6
For N = 4
Input format :
Output format :
Sample Input :
Sample Output :
Pattern - 7
For N = 3
Input format :
Output format :
Sample Input :
Sample Output :
Pattern - 8
Note: each line consists of an equal number of characters + spaces. Suppose you are printing the xth line for N=n. You need to print 1..x followed by (n-x) spaces, again (n-x) spaces followed by x..1
For N = 5
Sample Input :
Sample Output :
Tags:
Solutions