How to print multiple blank lines in C#?

CsharpProgrammingServer Side Programming

To display multiple blank lines, we will take a while loop.

Here, we are printing 10 blank lines using Console.WriteLine();

while (a < 10) {
   Console.WriteLine(" ");
   a++;
}

The following is the complete code to display multiple blank lines −

Example

using System;
namespace Program {
   public class Demo {
      public static void Main(String[] args) {
         int a = 0;
         while (a < 10) {
            Console.WriteLine(" ");
            a++;
         }
         Console.WriteLine("Displayed 10 blank lines above!\n");
         Console.ReadLine();
      }
   }
}
raja
Published on 20-Aug-2018 13:15:48
Advertisements