I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
Index » Programming » C/C++ »

will\′s Photo
27 Sep 07, 9:14AM
#include <stdio.h>
void triangle(int N)
{
  for(int i=0;i<N;i++)
  {
    putchar('\n');
    for(j=0;j<i;j++) putchar('*');
  }
}
 
int main()
{
  triangle(5);
}

That should do it. I'm sure you can figure out how to get user input for the numer N. Try scanf!

W

Currently you need to be logged in to leave a message.