hi,
I m making a graph with all (x,y) printed on graph line..like from +x=1,2,3....so on and same with -x,+y,-y.
below I tried u can try this too but I want clean graph with nos. on it.
can someone solve it?
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
int gdriver = DETECT, gmode, errorcode;
char ch;
initgraph(&gdriver, &gmode, "c:/tc/bgi");
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* return with error code */
}
// line(0, 0, getmaxx(), getmaxy());
line(getmaxx()/2,0,getmaxx()/2,getmaxy());
line(0,getmaxy()/2,getmaxx(),getmaxy()/2);
// ch = '0';
outtextxy(getmaxx()/2,getmaxy()/2,"(0,0)");
getch();
closegraph();
return 0;
}