VOOZH about

URL: https://www.geeksforgeeks.org/dsa/program-stair-case-patterns/

⇱ Program for Stair Case Patterns - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Program for Stair Case Patterns

Last Updated : 20 Feb, 2023

Programs to print following pattern.
Examples: 

Input : 6
Output :
* *
* *
* * * *
* * * *
* * * * * *
* * * * * *

Output: 

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


Program to print following pattern.
Examples: 

Input : 6
Output :
 * * 
 * * 
 * * * * 
 * * * * 
* * * * * * 
* * * * * * 

Output: 

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


Program to print following pattern.
Examples: 

Input : 6
Output :

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

Output: 

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


Program to print following pattern.
Examples: 

Input : 6
Output :

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

Output: 

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

Time complexity: O(n^2) for given n

Auxiliary space: O(1)
 

Comment