Write a program in c /c++ using open GL to draw a rectangle green color and inside the draw a circle of blue colour
Answers
Answered by
1
Answer:
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"C://TURBOC3//bgi");
int x = 250;
int y = 250;
int radius=100;
// setting border color
int border_color = WHITE;
// set color and pattern
setfillstyle(HATCH_FILL,RED);
// x and y is a position and radius is for radius of circle
circle(x,y,radius);
// fill the color at location (x, y) with in border color
floodfill(x,y,border_color);
getch();
// closegraph function closes the graphics mode and deallocates all memory allocated by graphics system
closegraph();
}
Explanation:
hope this will help u...
Similar questions