Home > Backend Development > C#.Net Tutorial > How to print multiple blank lines in C#?

How to print multiple blank lines in C#?

WBOY
Release: 2023-08-28 10:13:05
forward
1370 people have browsed it

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++;
}
Copy after login

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

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template