#include< stdio.h> /* Leave No space b/w < and stdio.h */
void main()
{
int i;
clrscr();
for( i=0; i<=15; i++ )
{
textcolor(i);
cprintf("Microsoft, Google, Yahoo, Oracle, eBay, PayPal \r\n");
}
getch();
}
textcolor() function takes color code as it’s parameter, and this color is taken bycprintf() function and the parameter(string) passed to cprintf is printed in the color given by textcolor() function.
| Color Name
———- | Color code
———- |
| BLACK
BLUE
GREEN
CYAN
RED
MAGENTA
BROWN
LIGHTGRAY
DARKGRAY
LIGHTBLUE
LIGHTGREEN
LIGHTCYAN
LIGHTRED
LIGHTMAGENTA
YELLOW
WHITE | 0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 |
0 comments:
Post a Comment
Thanks for your valuable Comment