Blogger news

C Language

1.Drawing BD flag using C language


#include<stdio.h>
#include<conio.h>
#include<graphics.h>
 main ()
{
int driver,mode,i,j;
clrscr();

driver=DETECT;
  initgraph(&driver,&mode,"c:\\tc\\bgi"); // here you have to change the directory.if you install your software at "D" drive then you have write(&driver,&mode,"d:\\tc\\bgi")

  for(i=0;i<120;i++)
  {
  for(j=0;j<64;j++)
  {
  rectangle(0+j*50,0+i*40,50+j*50,40+i*40);
  }
  }
  setcolor(6);
  setbkcolor(2);
  setfillstyle(1,6);
  for(i=0;i<120;i++)
  {
  for(j=0;j<64;j++)
  {
  circle(25+j*50,20+i*40,10);
  floodfill(25+j*50,20+i*40,6);
  }
  }

getch();
}

No comments:

Post a Comment