hey guys lol to be honest...i just got this based off of luck x.x
idk how but i can't keep doing this with the rest of my programs lol
this is a program for an asterick pattern
any way i can improve it just by using for loops?please im open for suggestions :)
- 3 spaces then an asterick, spaces decrement and increment and asterick increases by 2 then decrements by 2
int main()
{
int c,c_1,c_2,c_3,c_4,c_5,c_6;
for(c=1;c<=3;c++)
{
for(c_1=3;c_1>=c;c_1--)
printf(" ");
for(c_2=1;c_2<=(c_1+c+c+c_1);c_2+=2)
printf("*");
printf("\n");
}
for(c_3=1;c_3<=7;c_3++)
{
printf("*");
}
printf("\n");
for(c_4=1;c_4<=3;c_4++)
{
for(c_5=1;c_5<=c_4;c_5++)
printf(" ");
for(c_6=14;c_6>=(c_4+c_5+c_4+c_5);c_6-=2)
printf("*");
printf("\n");
}
return 0;
}
Output on Codeblocks by mingw
*
***
*****
*******
*****
***
*