hari-eur / Sruthi-priya---Gautham

0 stars 0 forks source link

Program 2 #2

Open Gauthkum opened 1 year ago

Gauthkum commented 1 year ago

Try to solve this warmup problem (https://www.hackerrank.com/challenges/staircase/problem) from Hacker Rank and share me the code and output. Share the complexity in which your code is working.

Srudurai commented 1 year ago

include

include

include

include

int main() { int n, i,j; scanf("%d", &n); for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(j<(n-1-i)) printf(" "); else printf("#"); } printf("\n"); }

/* Enter your code here. Read input from STDIN. Print output to STDOUT */    
return 0;

}

output: #

the complexity of the code: O(n^2)