to generate colors use inbuilt color function setcolor (color code) i do not no exact . it may be color (color code) color code is an integer value for each color.
This is console colour code.You may use it for colour . Code: #include <stdio.h> #include <windows.h> int main(){ HANDLE hConsole; int k; hConsole = GetStdHandle(STD_OUTPUT_HANDLE); for(k = 1; k < 350; k++) { SetConsoleTextAttribute(hConsole, k); printf("%3d %s\n", k, "I want to be nice today!"); } getch(); } // wait return 0;}
Brother this Code is Operating system dependent,it works fine on my 32 bit pc. I can give you another code for this you can try this by changing 2a to some other n0 or letter.. Code: #include <stdio.h> int main(){ system("color 2a"); //try to change 2a for colour changes printf("HELLO WORLD"); getch(); }