brindha
Answered On : Oct 9th, 2011
Printf is the statement only display what we are given inside the statement so if you are giving the colors in that statement it will display only the color name.
EX:
main()
{
printf("Red");
}
output:
Red
Login to rate this answer.
There are already made functions in Header file Conio.h
textcolor(5) will change the color to the pink.similarly by changing the value we get different colors.

1 User has rated as useful.
Login to rate this answer.
Not directly. The printf function simply sends formatted text to the output stream. However, with some terminals, you can send control codes as part of the formatted text, and these control codes can change the terminals display characteristics, including text color. For example, sending the sequence 33 to a terminal that understands ANSI escape sequences will clear the display. It depends on the terminal, though.
Login to rate this answer.
Prashant Shetty
Answered On : Aug 17th, 2012
include conio.h header file and textcolor(int value) function and dont forget to use cprintf statement :
ex:
Code
textcolor(2);
cprintf("hell world");
now hello world will be displayed in yellow color
Login to rate this answer.