# Hacker Rank solution for Staircase in C++

Problem:- staircase solution in C++ or staircase hacker rank solution in Java or staircase hacker rank solution c++ or staircase hacker rank solution c++ or staircase program in c or staircase solution in c or staircase hacker rank solution in python or staircase in java or staircase hacker rank solution in c or Hacker Rank Solution For staircase in C++ or staircase in C++ or Hacker Rank solution for staircase in C++.

Logic:- staircase hacker rank solution there is no logic we have to just print the pattern in a staircase by using the hash (#) symbol. we always use stairs in our daily life now turn to implement in programming life. See the below pattern this is called a staircase.When asking for the user to enter the number that means the height of staircase. In this case, I am taking Height = 10.

Staircase Pattern

#
##
###
####
#####
######
#######
########
#########
##########

Check- Geeksforgeeks solution for School, Basic, Easy, Medium, Hard Domain.

Submit your solution here:- Click here

Tip:- Before copy the solution I recommended please read this full article, this will help you to build your own logic.

Solution:-

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
int n,i,j,k;
cin >> n;

for(i=n;i>=1;i--)

{
for(j=1;j<i;j++)
{
cout<<" ";
}
for(k=n;k>=i;k--)
{
cout<<"#";
}
cout<<endl;
}

return 0;
}

Output:-