VOOZH about

URL: https://www.geeksforgeeks.org/c-sharp/console-resetcolor-method-in-c-sharp/

⇱ Console.ResetColor() Method in C# - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Console.ResetColor() Method in C#

Last Updated : 11 Jul, 2025

Console.ResetColor() Method is used to the foreground and background console colors to their defaults i.e. background to black and foreground to white.
Syntax: 
 

public static void ResetColor ();


Exceptions: 
 

  • SecurityException: If the user does not have permissions to perform the action.
  • IOException: If an I/O error occurred.


Below programs illustrate the use of the above-discussed method:
Example 1: Setting the console colors to red and yellow
 

Output:
 

👁 Image


Example 2: Resetting the colors to default
 

Comment
Article Tags:

Explore