How to change Background and Foreground color of Console in C

<windows.h> provides various functions to change the properties of windows like changing color, resizing windows, changing cursor position etc. The source code for changing the background and foreground color of console is given below. You can pass different color values to the function to get different color in background and foreground.

Output

 

bfcolor

SHARE How to change Background and Foreground color of Console in C

You may also like...

2 Responses

  1. Anonymous says:

    There are 5 errors in your program

  2. Hey this program only runs on Windows OS and GNU GCC compiler. It gives errors if run in other platform.

Leave a Reply

Your email address will not be published. Required fields are marked *

Share