Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Parth1906
GitHub Repository: Parth1906/SPPU-2019-Pattern-SE-COMP-Computer-Graphics-Practicals
Path: blob/main/2. Basic Shapes.cpp
724 views
1
/*
2
2. Write a C++ program to divide screen into
3
four region and draw circle,rectangle,arc
4
and ellipse.
5
*/
6
7
#include<iostream.h>
8
#include<conio.h>
9
#include<graphics.h>
10
#include<stdio.h>
11
int main()
12
{
13
int gdriver = DETECT, gmode;
14
int xmax,ymax;
15
initgraph(&gdriver, &gmode,"c:\\turboc3\\bgi");
16
xmax = getmaxx();
17
ymax = getmaxy();
18
line(xmax/2,0,xmax/2,ymax);
19
line(0,ymax/2,xmax,ymax/2);
20
circle(170,125,100);
21
rectangle(58,251,304,392);
22
arc(500,150,45,135,100);
23
ellipse(500,300,0,360,75,25);
24
getch();
25
closegraph();
26
return 0;
27
}
28
29