-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4.c
More file actions
39 lines (38 loc) · 826 Bytes
/
Copy path4.c
File metadata and controls
39 lines (38 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//4. WAP to draw basic shapes using linerel() function [Hint: rectangle, triangle , square and polygon]
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int gdrive=DETECT,gmode;
initgraph(&gdrive, &gmode,"C:/turboc3/bgi");
moveto(10,50);
linerel(100,0);
linerel(0,100);
linerel(-100,0);
linerel(0,-100);
settextstyle(6,0,4);
outtextxy(10,150,"Square");
moveto(210,50);
linerel(60,100);
linerel(-110,0);
linerel(50,-100);
settextstyle(6,0,4);
outtextxy(170,150,"Triangle");
moveto(300,50);
linerel(0,100);
linerel(170,0);
linerel(0,-100);
linerel(-170,0);
settextstyle(6,0,4);
outtextxy(330,150,"Rectangle");
moveto(20,250);
linerel(-20,100);
linerel(160,0);
linerel(20,-100);
linerel(-160,0);
settextstyle(6,0,4);
outtextxy(8,350,"Quadilateral");
getch();
closegraph();
}