- How can I increment stars in a do while loop not for loop.
Output should be :
*
**
***
****
- How to assign
i
to"*"
in following
do
{
Console.WriteLine("{i}", i);
i++;
} while (i <= 10);
Output should be :
*
**
***
****
i
to "*"
in followingdo
{
Console.WriteLine("{i}", i);
i++;
} while (i <= 10);
If you are looking to write a number of "asterixis" on a single line based on a do-while. A simple solution would be:
int i = 0;
do
{
Console.WriteLine(new String('*', i));
i++;
} while (i <= 10);
Although I may not be understanding your question