Home  >  Article  >  Backend Development  >  How to print multiple blank lines in C#?

How to print multiple blank lines in C#?

WBOY
WBOYforward
2023-08-28 10:13:051310browse

How to print multiple blank lines in C#?

To display multiple empty lines, we will use a while loop.

Here, we use Console.WriteLine() to print 10 blank lines;

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();
      }
   }
}

The above is the detailed content of How to print multiple blank lines in C#?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete