หากต้องการแสดงบรรทัดว่างหลายบรรทัด เราจะวนรอบสักครู่
ที่นี่ เรากำลังพิมพ์บรรทัดว่าง 10 บรรทัดโดยใช้ Console.WriteLine();
while (a < 10) {
Console.WriteLine(" ");
a++;
} ต่อไปนี้เป็นรหัสที่สมบูรณ์เพื่อแสดงบรรทัดว่างหลายบรรทัด -
ตัวอย่าง
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();
}
}
}