
March 5th, 2013, 12:59 AM
|
|
Registered User
|
|
Join Date: Jan 2013
Posts: 13
Time spent in forums: 7 h 8 m 34 sec
Reputation Power: 0
|
|
|
Nested Loop
Hello everyone! its me again
my target screen output is supposedly this:
[IMG]  [/IMG]
but my actual screen output is this  the code for space for the body is not working)
so here is my code:
Code:
#include <stdio.h>
#include <conio.h>
int main()
{
int outer,inner,space;
for(outer=1;outer<=9;outer+=2)
{
for(space=7;space>=outer;space-=2);
{
printf(" ");
}
for(inner=1;inner<=outer;inner++)
{
printf("*");
}
printf("\n");
}
for(outer=1;outer<=3;outer++)
{
for(space=2;space>=3;space++)
{
printf(" ");
}
for(inner=1;inner<=5;inner++)
{
printf("*");
}
printf("\n");
}
getch();
return 0;
}
PLEASE HELP! thank you
|