C++ program to draw a Pixel by accepting coordinates from the user
gd.cpp
#include<graphics.h>
#include<iostream>usingnamespacestd;intmain(){intgd=0,gm=9,x1,y1;cout<<"Enter the x coordinate ";cin>>x1;cout<<"Enter the y coordinate ";cin>>y1;initgraph(&gd,&gm,NULL);putpixel(x1,y1,15);delay(2000);return0;}
Output
godarda@gd:~$ g++ gd.cpp -lgraph godarda@gd:~$ ./a.out
Enter the x coordinate 50
Enter the y coordinate 50
Dear User, Thank you for visitng GoDarda. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.