C++ program to draw a Pixel by accepting coordinates from the user
kw.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
kodingwindow@kw:~$ g++ kw.cpp -lgraph kodingwindow@kw:~$ ./a.out
Enter the x coordinate 50
Enter the y coordinate 50
Dear User, Thank you for visitng KodingWindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.