How to print multiple blank lines in C#?


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!
");          Console.ReadLine();       }    } }

Updated on: 22-Jun-2020

504 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements