Empowering CS learners, aspiring programmers, and startups with AI, Data Science & Programming insights — scaling skills from learning foundations to enterprise-grade solutions.
int main(void)
{
int t = get_int(“no. of bricks “);
for (int i=0; i<t; i++)
{
printf(“#\n”);
}
}
Seeking hints/help regarding formulating a suitable loop that will help print 1 hash in the first line, 2 hashes in the second line, 3 hashes in the third line and so on.
Is there a way to multiply the output with printf command.
On first row, 1x#.
Second row, 2x#
Third row, 3x#.
While printf(“#\n”) taking care of printing 1 hash and moving to next line, is there a way to leverage the printf command with loop to print # twice for second row, and so on?