30 likes | 463 Views
Start. int driver, mode. rectangle(100,100,200,150) line(150,100,150,150) line(125,100,125,150) line(175,100,175,150). line(100,160,125,160) line(125,160,150,210) line(150,210,175,160) line(175,160,200,160) line(200,160,200235) line(200,235,100,235)
E N D
Start int driver, mode rectangle(100,100,200,150) line(150,100,150,150) line(125,100,125,150) line(175,100,175,150) line(100,160,125,160) line(125,160,150,210) line(150,210,175,160) line(175,160,200,160) line(200,160,200235) line(200,235,100,235) line(100,235,100,160) DRAW ING OF V BLOCK. Output stop
Start program Define data type Explanation draw a v-block using rectangle and line function Display v-block in output end of program
Program: /*program to prepare a drawing of v-block*/ #include<conio.h> /*header file included*/ #include<graphics.h> /*graphics header file included*/ void main() /*execution of program starts here*/ { /*starting braces*/ int driver,mode; /*data type defined that must be integer type variable*/ detectgraph(&driver,&mode); /*driver and modes are set*/ initgraph(&driver,&mode,"\\BGI"); /*graphic mode is initialized*/ setpalette(0,23); setcolor(5); /*set object color*/ /*draw v-block*/ rectangle(100,100,200,150); line(150,100,150,150); line(125,100,125,150); line(175,100,175,150); setcolor(6); line(100,160,125,160); line(125,160,150,210); line(150,210,175,160); line(175,160,200,160); line(200,160,200,235); line(200,235,100,235); line(100,235,100,160); getch(); restorecrtmode(); }