I need method of lines, so that when you have method call Rows (4), a method prints four blank lines.
This is my code but it wont work, tell me what is wrong?
namespace something
{
class Program
{
static void Main(string[] args)
{
Console.Write("give number: ");
int lines = int.Parse(Console.ReadLine());
line(lines);
Console.WriteLine("lines end");
Console.ReadKey();
}
private static void line(int lines)
{
for (int i = 1; i <= lines; i++);
Console.WriteLine(" ");
}
}
}
Remove
;at the end:In this case your
Console.WriteLine(" ");called only once after loop finished. Loop doing nothing.