Task for Co ders
Construct a rectangle .
Mention steps
Answers
Answered by
7
★ Construction of rectangle ☆
★ Using turbo C++ GRAPHICS ☆
- //First, include header file in program
#include<iostream.h>
#include<graphic.h>
int main()
{
- //gm is Graphics mode which is a computer display
- //mode that generates image using pixels.
- //DETECT is a macro defined in "graphics.h" header file
int gd = DETECT, gm;
- //location of left, top, right, bottom
int left = 150, top = 150;
int right = 450, bottom = 450;
- //initgraph initializes the graphics system
- //by loading a graphics driver from disk
initgraph(&gd, &gm, "");
- //rectangle function
rectangle(left, top, right, bottom);
getch();
- //closegraph function closes the graphics
- //allocate and deallocates all memory
- //by graphics system .
closegraph();
return 0;
}
- //Expected output in attachment
You can also made this using java , python , Android studio
HAPPY CODING ✔️
Attachments:
Similar questions