C Help - Nested Loops

Associate
Joined
14 Jun 2009
Posts
1,568
Hi,

I'm new to C and struggling quite a bit with the following.

I need to draw the following:
yZwBV.jpg

I've managed to draw a 5 x 4 grid of *'s using the following:

PHP:
#include <stdio.h>
int main(void)
{
  int row;
  for (row = 0 ; row < 4 ; row++)
    {
      int column;
      for (column = 0 ; column < 5 ; column++)
	{
	  printf("*");
	}
      printf("\n");
    }
  return 0;
}

I know I almost certainly need another nested loop somewhere but I really have no idea where to start if i'm honest :(

Any help is appreciated.
 
Back
Top Bottom