|
From: <Tre...@ao...> - 2001-07-19 17:35:24
|
I have to write a program that uses a nested while loop in order to display
lines of asterisks from 9 to 1. Here is the code.....can anyone help me? I
don't understand how to make this work.
#include<iostream>
int main()
{
int asterisk = 9;
int counter = 9;
char ast = '*';
asterisk = (asterisk * ast);
while (counter > 0)
{
cout << asterisk << endl;
counter = counter - 1;
asterisk = asterisk - ast;
while (asterisk > 0)
{
cout << "*" << "" << endl;
}
}
return 0;
}
|