Share it

Bookmark and Share

Translate

Friday, June 1, 2012

0 Colorful Text Output: C program


#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 WHITE0 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

 

TechnoTipworld- Tips,Tricks,Technology Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates