In: Computer Science
I need to know how to build a flag in c++ for Italy
#include<stdio.h>
#include<graphics.h>
#include<math.h>
int main(){
int gd,gm;
detectgraph(&gd,&gm); //detectgraph is used to find out
the current graphics driver and mode
initgraph(&gd,&gm,"C:\\TURBOC3\\BGI");
//initgraph function is used to initialize with the //graphics
library and changes to //the graphics screen for drawing.
//draw the leftmost rectangle and color it
setcolor(GREEN);
rectangle(100,150,150,250); //rectangle(int left, int
top, int right, int bottom);
// left specifies the X-coordinate of top left corner,
top specifies the Y-coordinate of top left //corner, right
specifies the
//X-coordinate of right bottom corner, bottom specifies
the
//Y-coordinate of right bottom corner.
setfillstyle(SOLID_FILL,GREEN); //setfillstyle()
function which sets the current fill pattern and //fill color
floodfill(101,151,GREEN); //floodfill() function is
used to fill an enclosed area.
//draw the middle rectangle and color it
setcolor(WHITE);
rectangle(150,150,200,250);
setfillstyle(SOLID_FILL,WHITE);
floodfill(151,151,WHITE);
//draw the righmost rectangle and color it
setcolor(RED);
rectangle(200,150,250,250);
setfillstyle(SOLID_FILL,RED);
floodfill(201,151,RED);
getch();
closegraph();
return 0;
}