टेक्स्ट का फोरग्राउंड कलर बदलने के लिए C# में Console.ForegroundColor प्रॉपर्टी का उपयोग करें।
उदाहरण
आइए एक उदाहरण देखते हैं:
using System;
class Demo {
public static void Main (string[] args) {
Console.BackgroundColor = ConsoleColor.Blue;
Console.WriteLine("बैकग्राउंड कलर बदला गया = " + Console.BackgroundColor);
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("\nफोरग्राउंड कलर बदला गया = " + Console.ForegroundColor);
}
}
आउटपुट
यह निम्नलिखित आउटपुट देगा:
