Well, i cant figure how print to the spaces before the *, this is how it is suppose to look:
*
***
*****
*******
EDIT: dunno how to get it to work but it should be a pascal triangle
and this is what i get
*
***
*****
*******

heres the code:

#include<stdio.h>
void main ()
{
	int a, b, c;
	printf ("Enter the number: ");
	scanf ("%d", &a);
		
		for (b=1; b<=a; b++)
		{			
			for (c=1; c<=(b*2-1); c++) 
				{									
					printf ("*");
				}
			printf ("\n");	
		} 		


	return;
}
void main ()
{
        int a, b, c;
        printf ("Enter the number: ");
        scanf ("%d", &a);
        for (b=1; b<=a; b++)
        {
                for(c = a-b; c>0; c--)
                {
                        printf(" ");
                }
                for (c=1; c<=(b*2-1); c++)
                {
                        printf ("*");
                }
                printf ("\n");
        }
}
commented: Please don't just give away solutions, help the poster approach the problem +0

start quote:

void main ()
{
        int a, b, c;
        printf ("Enter the number: ");
        scanf ("%d", &a);
        for (b=1; b<=a; b++)
        {
                for(c = a-b; c>0; c--)
                {
                        printf(" ");
                }
                for (c=1; c<=(b*2-1); c++)
                {
                        printf ("*");
                }
                printf ("\n");
        }
} 

end quote.

thanks for the help :)

is this what you mean?

#include <stdio.h>

 int x,y;

 main()
 {
    for ( x = 0; x < 10; x++, printf( "\n" ) )

        for ( y = 0; y < (x*2-1); y++ )

            printf( "X" );

    return 0;
 }
commented: Did you read the comments on the other post? +0
commented: Man, 185 posts and you're still giving away homework solutions? Get it together, man! -2
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.