diff --git a/Stair-Case Problem using C b/Stair-Case Problem using C new file mode 100644 index 00000000000..461aa8d058f --- /dev/null +++ b/Stair-Case Problem using C @@ -0,0 +1,39 @@ +Fixes #6623. + +#include +#include +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"); + } +}