google search

Popular Posts


Welcome to BCA Notes

>>>>>>>>>>>>>>>>

Visitors

Search This Blog

Blogger templates

Visitor Map


Friday, 5 June 2015

Create a LINE USING line function in cpp?

2. Create a LINE USING line function in cpp?


#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<iostream.h>
int main()
{
   int gd=DETECT,gm;
   //graphic construct is DETECT
   initgraph(&gd,&gm,"c:\\TurboC3\\BGI\\");
   //init graph has three parameter graphic driver graphic mode,bgi graphic path
   clrscr();
   //                 clear screen
   int x,y,x1,y1;
   cout<<"Enter x,y,x1,y1"<<endl;
   cin>>x>>y>>x1>>y1;
   line(x,y,x1,y1);
   //line(x,y,x1,y1)
      getch();
   closegraph();
   //closegraph();
     return(0);
}


0 comments:

Post a Comment