INTRODUCTION :
In this article I will show you how to draw rectangle by C or C++ using rectangle function. rectangle is built-in function in graphics header
Declaration :
rectangle(int l, int t, int r, int b);
How to use :
For use this function you have to install turboc++. In this example I will show you how to draw a rectangle using C or C++ programing. The following code draws a rectangle. Just create a c file in turboc++ and copy paste following code in it.
/*Developed by Puskar Jasu*/
#include <graphics.h>
#include <conio.h>
main()
{
int l, t, r, b;
int graphic_driver = DETECT, graphic_mode;
initgraph(&graphic_driver, &graphic_mode, "//turboc3/bgi");
setcolor(4);
l = 200;
t = 100;
r = 400;
b = 300;
rectangle(l, t, r, b);
getch();
closegraph();
return 0;
}
Output :
you can see the output in your pc.
CONCLUSION :
In this article I show you how you draw rectangle in C graphics by turboc++. Thanks for visit my site.
You can see my following project :
- draw arc with color by c with source code
- How to create banner by c with source code
- how to create lighting with sound by c graphics with source code
You can see my following program :
- How to Write Hello World Program in C
- How to Input Output in C Program
- How to Add Numbers Input by User in C Program
Post navigation