-1
  1. How can I increment stars in a do while loop not for loop.

Output should be :

*  
**  
***  
****  
  1. How to assign i to "*" in following
do
{
    Console.WriteLine("{i}", i);
    i++;
} while (i <= 10);
Sinatr
  • 18,856
  • 9
  • 75
  • 248

1 Answers1

-1

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

Luc
  • 152
  • 8