Answer the question
In order to leave comments, you need to log in
How to print 5 asterisks in reverse order and so that they are in descending order and on a new line using while?
For example:
*****
****
***
**
*
Answer the question
In order to leave comments, you need to log in
char asterisk[] = "*****", *pa = &asterisk;
while( *pa != 0 )
cout << pa++ << endl;
int marker = 5;
while(marker)
{
int inner_marker = marker;
while(inner_marker--)
std::cout << "*";
std::cout << std::endl;
--marker;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question