wrote:
> #include "stdio.h"
> #include "math.h"
> int main()
> {
> int line,spaces,stars,loop;
>
> for (line=1; line<=5; line++)
> spaces=int abs(line-5);
> for (loop=1; loop<=spaces; loop++)
> printf(" ");
> stars=line+(line-1);
> for (loop=1; loop<=stars; loop++)
> printf("*");
> return 0;
> }
>
> I did the first 5 lines and try to debugg it but doesn't work
>
>
OK, that's pretty close. The thing you missing is that you need to put
the second for loop inside the first for loop. Now maybe you thought
that is what you need, or maybe you weren't quite sure if it was
necessary. Ether way this small change (adding { and } )will help
for (line=1; line<=5; line++)
{
spaces=int abs(line-5);
for (loop=1; loop<=spaces; loop++)
printf(" ");
stars=line+(line-1);
for (loop=1; loop<=stars; loop++)
printf("*");
}
Still not quite right because you never output a newline, but I'm sure
you can figure that one out.
john