How to add Background and Font color to C and C++ program?

Finding out on the internet about how to add GUI in C and C++, I found that its a tough job to apply GUI in C and C++. So here is a very simple method to add background color and font color in c and c++. Without wasting any time, lets get started.




enter the codes inside any function or main() funtion:

system("color 9F");

Thats it. after adding this, the background colour will turn to blue, and the font color will turn to bright white. 
Note that here, 9 i.e. the first hexa code indicates the background color and F indicates font color. 

Here are color values with color:

    0 = Black       8 = Gray
    1 = Blue        9 = Light Blue
    2 = Green       A = Light Green
    3 = Aqua        B = Light Aqua
    4 = Red         C = Light Red
    5 = Purple      D = Light Purple
    6 = Yellow      E = Light Yellow
    7 = White       F = Bright White

Must try this trick in your program. You try and change different color after different activities of your program, so it will keep changing repeatedly. 

See you next time : )

Comments