Rain & Umbrella - Graphics Programming - C++ Program

Rain & Umbrella - Graphics Programming - C++ Program

Source code:
#include<iostream>
#include<graphics.h>
using namespace std;
int main()
{
 int gd=DETECT,gm,x,y,j,i;
 initgraph(&gd,&gm,NULL);
 
    outtextxy(150,15, "Rain & Umbrella");
 int points[]={50,100,150,100,150,getmaxy(),50,getmaxy(),50,100 };
 
 
 for(i=0;i<getmaxy();i+=5)
 for(j=0;j<getmaxx();j+=15)
 putpixel(j,i,WHITE);
 setcolor(RED);
 arc(100, 100, 180, 360, 50);
 line(50,99,150,99);

 setcolor(BLACK);
 fillpoly(5,points);
 setcolor(WHITE);
 line(100,100,100,175);
 arc(80, 175, 0, 180, 20);
 
 getch();
 closegraph();
 return 0;
}

Output:
nn@linuxmint ~ $ g++ g7.cpp -lgraph
g7.cpp: In function ‘int main()’:
g7.cpp:9: warning: deprecated conversion from string constant to ‘char*’
nn@linuxmint ~ $ ./a.out
a.out: ../../src/xcb_io.c:249: process_responses: Assertion `(((long) (dpy->last_request_read) - (long) (dpy->request)) <= 0)' failed.
nn@linuxmint ~ $ 

4 comments:

Related Posts Plugin for WordPress, Blogger...