Syntax:
system("color 71");
This
This statement has two parts in left side '7' is background color
code and on right side '1' is text color code. This statement can use in main function.
You can use following color codes :
0 = Black
1 = Blue
2 = Green
3 = Aqua
4 = Red
5 = Purple
6 = Yellow
7 = White
8 = Gray
9 = Light Blue
A= Light Green
B= Light Aqua
C= Light Red
D= Light Purple
E= Light Yellow
F= Bright White
Program:
#include <iostream> using namespace std; int main() { system("color71"); cout << "This statement have two parts in left side 7 is"<<endl; cout<<"background color code and on right side 1 is text color "<<endl; cout<<"code and you can use this in main function" <<endl; return 0; }
Change background in C++
ReplyDelete