Aim: Draw a Cordinates Axis At The Center Of The Screen.
Source Code:
#include<graphics.h>
#include<iostream.h>
#include<coino.h>
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TURBOC3\\BGI");
line(getmaxx()/2,0,getmaxx()/2,getmaxy());
line(0,getmaxy0/2,getmaxx(),getmaxy()/2);
getch();
closegraph();
}
Output:
Source Code:
#include<graphics.h>
#include<iostream.h>
#include<coino.h>
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TURBOC3\\BGI");
line(getmaxx()/2,0,getmaxx()/2,getmaxy());
line(0,getmaxy0/2,getmaxx(),getmaxy()/2);
getch();
closegraph();
}
Output:
No comments:
Post a Comment