C Programming Tutorial

 
 
 
 
#include<graphics.h>
#include<conio.h>
#include<stdio.h>
#include <stdlib.h>

//for itoa()

//////////////////////
int huge mode(void)
{return(4);}
/////////////////////

void main()
{
int gd=0,gm=0;

//////////////
installuserdriver(\"svga256\",mode);
//////////////

initgraph(&gd,&gm,\"\");

settextstyle(TRIPLEX_FONT,HORIZ_DIR,4);
setcolor(250);


char str[5];
for(int i=20;i<220;i++){
    setfillstyle(1,i);
    bar(0,0,1022,765);
    outtextxy(25,15,\"Color Number is : \");
    itoa(i,str,10);
    outtextxy(315,15,str);
    getch();
}

outtextxy(150,150,\"Syntax-Example\");
getch();


closegraph();
}

 
 
Didn't find what you were looking for? Find more on Program to display 256 different colors