Sample input 6
Sample Output
Sample Output
#
##
###
####
#####
######
Solution-
int n = Convert.ToInt32(Console.ReadLine());
for(int i = 1; i <= n; i++)
{
for(int j = 1; j <= n; j++)
{
if (j <= n - i)
{
Console.Write(" ");
}
else
{
Console.Write("#");
}
}
Console.WriteLine();
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.