Hackerrank Solution StairCase in C language | Algorithms
HackerRank Online Judge Solution StairCase | Algorithms
HackerRank Main Problem Link - https://www.hackerrank.com/challenges/staircase
Problem Name: HackerRank Problem StairCase
Problem Number : HackerRank Problem StairCase Solution
Online Judge : HackerRank Online Judge Solution
Category: Algorithm
Solution Language : C, C plus plus
HackerRank Solution StairCase Code in C,CPP:
#include<stdio.h> int main() { int n, space = 0, hash = 0, i, j; scanf("%d", &n); for(i = 0; i < n; i++) { space = n - (i+1); for(j = 0; j < space; j++) { printf(" "); } hash = i + 1; for(j = 0; j < hash; j++) { printf("#"); } printf("\n"); } }
No comments:
Post a Comment