Aim: Write a Program Demonstrate Varoius Shapes Using Redimate Graphics Primitive.
Source Code:
#include<graphics.h>
#include<iostream.h>
#include<conio.h>
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TURBOC3\\BGI");
circle(100,100,50);
outtextxy(75,170,"CIRCLE");
rectangle(200,50,370,150);
outtextxy(250,170,"RECTANGLE");
ellipse(500,100,0,360,80,30);
outtextxy(470,170,"ELLIPSE");
line(100,220,500,220);
outtextxy(300,240,"LINE");
sector(100,350,10,330,50,50);
outtextxy(70,420,"SECTOR");
pieslice(300,350,40,90,50);
outtextxy(270,420,"PIESLICE");
arc(500,350,0,80,50);
outtextxy(520,420,"ARC");
getch();
closegraph();
}
Output:
Source Code:
#include<graphics.h>
#include<iostream.h>
#include<conio.h>
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TURBOC3\\BGI");
circle(100,100,50);
outtextxy(75,170,"CIRCLE");
rectangle(200,50,370,150);
outtextxy(250,170,"RECTANGLE");
ellipse(500,100,0,360,80,30);
outtextxy(470,170,"ELLIPSE");
line(100,220,500,220);
outtextxy(300,240,"LINE");
sector(100,350,10,330,50,50);
outtextxy(70,420,"SECTOR");
pieslice(300,350,40,90,50);
outtextxy(270,420,"PIESLICE");
arc(500,350,0,80,50);
outtextxy(520,420,"ARC");
getch();
closegraph();
}
Output:
No comments:
Post a Comment