Program to print bars of different colors.

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

void main()
{
  clrscr();
  int gm=DETECT,gd,i;

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

  cleardevice();
  for(i=1;i<=11;i++)
  {
    setfillstyle(i,i);
    setcolor(i);
    cleardevice();
    bar(50,70,70,300);

    getch();
 }
    getch();
}

Leave a Reply