im beginning with c# and im at a chapter where " while for switch" is explained i need to to some exercices but there are a couple that i dont know how to do :\
it says to print something like
*********
********
*******
******
*****
****
***
**
*
just using "for" and a Console.Write("*");
i did one that looks
*
**
***
*****
and so on using something like... (uh not sure if this is the code exactly im remembering it, im not at home now...)
string asterisk="*";
for ( int counter = 1; counter <=10; counter++ , asterisk += "*")
{
Console.Write("*");
Console.Writeline("");
}
and it works but i cant do the inverse like at the beginning of the post .
Also the next exercice says to draw a Diamond using the * but with the large of a number beetwin 1 and 19 input by user...
Question
BlueRage
im beginning with c# and im at a chapter where " while for switch" is explained i need to to some exercices but there are a couple that i dont know how to do :\
it says to print something like
*********
********
*******
******
*****
****
***
**
*
just using "for" and a Console.Write("*");
i did one that looks
*
**
***
*****
and so on using something like... (uh not sure if this is the code exactly im remembering it, im not at home now...)
string asterisk="*";
for ( int counter = 1; counter <=10; counter++ , asterisk += "*")
{
Console.Write("*");
Console.Writeline("");
}
and it works but i cant do the inverse like at the beginning of the post .
Also the next exercice says to draw a Diamond using the * but with the large of a number beetwin 1 and 19 input by user...
i need a bit of help ^^ thx :D
Link to comment
Share on other sites
4 answers to this question
Recommended Posts