putpixel in c

Function name - putpixel
Definition- putpixel is used to plot a dot on screen at specified position with specified colour.
syntax- putpixel(int x,int y,pixelcolor);

Example c program for putpixel-

#include<graphics.h>
#include<conio.h>
void main()
{
int gd=DETECT, gm;
clrscr();
initgraph(&gd,&gm,"c:\\turboc3\\bgi");
putpixel(20,30,4);
getch();
closegraph();

}

Output-


As you can see red colour dot is placed at (20,30) position.

Comments

Popular posts from this blog

Java Program to print any matter

Line