# Void Function

Hello, does anyone know how to draw the figure below, using a void function?

\$\$\$\$\$\$\$\$\$
\$\$\$\$\$\$\$
\$\$\$\$\$
\$\$\$
\$
\$\$\$
\$\$\$\$\$
\$\$\$\$\$\$\$
\$\$\$\$\$\$\$\$\$

thanks...

• : Hello, does anyone know how to draw the figure below, using a void
: function?
:
: \$\$\$\$\$\$\$\$\$
: \$\$\$\$\$\$\$
: \$\$\$\$\$
: \$\$\$
: \$
: \$\$\$
: \$\$\$\$\$
: \$\$\$\$\$\$\$
: \$\$\$\$\$\$\$\$\$
:
: thanks...
:
Sure, there are many ways. What was your attempt?

bilderbikkel
• If I knew, I wouldnt be posting this... I need to know how, not to be asked how to do it!!!
• : If I knew, I wouldnt be posting this... I need to know how, not to
: be asked how to do it!!!

Here's the pseudo code for the first half:
[code]
for (i = 8; i > 1; i-=2) {
make string of \$ with length i
print string
}
[/code]
• I'd thought someone would've answered by now.

[code]void function()
{
for(int i=9;i>1;i-=2)
{
for(int i2=0;i2<i;i2++)
{
cout<<"\$";
}
cout<<endl;
}
for(int i=1;i<10;i+=2)
{
for(int i2=0;i2<i;i2++)
{
cout<<"\$";
}
cout<<endl;
}
}
int main()
{
function();
getchar();
}[/code]