Skip to content

Commit

Permalink
Merge pull request #6771 from manavb2214/patch-2
Browse files Browse the repository at this point in the history
Create Stair-Case Problem using C
  • Loading branch information
ossamamehmood authored Oct 30, 2023
2 parents 36d75bc + aba5466 commit 53fbfe2
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Stair-Case Problem using C
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Fixes #6623.

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,height,flag=0;

printf("Enter the Height = ");
scanf("%d",&height);

for(i = 0; i < height+1; i++)
{
for(j = 0; j < i; j++)
{
printf(" ");
}

if(i==height)
{
printf("|");
break;
}

for (k = 0; k < 1; k++)
{
if (flag == 0)
{
printf(" _");
flag=1;
}
else
{
printf("|_");
}
}
printf("\n");
}
}

0 comments on commit 53fbfe2

Please sign in to comment.