# Inverted pyramid of asterisk

Page 1 of 1

## 3 Replies - 23805 Views - Last Post: 03 July 2009 - 10:16 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=113087&amp;s=196f3886745599f7d6b28fd3e777864c&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 poppin'champ

Reputation: 0
• Posts: 6
• Joined: 28-June 09

# Inverted pyramid of asterisk

Posted 03 July 2009 - 08:36 PM

here's my code:
```#include<stdio.h>
#include<conio.h>
main()
{
int z,a,b,c;
clrscr();
printf("Level/s:");
scanf("%d",&c);
for(z=c;z>=1;z--)
{
for(a=0;a<=z;a++)
{
printf(" ");
}
for(b=c;b>=1;b--)
{
printf("*");
}
c=c-1;
printf("\n ");
}
getch();
}
```

the ouput of my code is:
Level/s:4
****
***
**
*

the output should be:
Level/s:4
* * * *
* * *
* *
*
it should be an inverted pyramid.

This post has been edited by poppin'champ: 03 July 2009 - 08:43 PM

Is This A Good Question/Topic? 0

## Replies To: Inverted pyramid of asterisk

### #2 Dantheman

• D.I.C Regular

Reputation: 34
• Posts: 445
• Joined: 27-May 09

## Re: Inverted pyramid of asterisk

Posted 03 July 2009 - 09:25 PM

Sorry dawg. We don't do people's homework here.

### #3 poppin'champ

Reputation: 0
• Posts: 6
• Joined: 28-June 09

## Re: Inverted pyramid of asterisk

Posted 03 July 2009 - 10:03 PM

Dantheman, on 3 Jul, 2009 - 08:25 PM, said:

Sorry dawg. We don't do people's homework here.

ow. the spacing in asterisks is all i wanted to ask.. to where i should place space or tab so that the asterisk may appear an inverted pyramid.

can you tell me where??

### #4 Oler1s

• D.I.C Lover

Reputation: 1396
• Posts: 3,884
• Joined: 04-June 09

## Re: Inverted pyramid of asterisk

Posted 03 July 2009 - 10:16 PM

Well, you can see that there are spaces in between the asterisks. Or, another way to look at it is that each asterisk is followed by a space. So if you are outputting '*" repeatedly, you would output what repeatedly instead?