Myth0147

Untitled

Jan 28th, 2016
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include<iostream.h>
  2. #include<conio.h>
  3. #include<graphics.h>
  4. void main()
  5. {
  6. clrscr();
  7. int gd=DETECT,gm;
  8. clrscr();
  9. initgraph(&gd,&gm,"c:\\tc\\bgi");
  10. int a[10][10],b[10][10],c[10][10],d[10][10],e[10][10],i;
  11. cout<< "enter the coordinates of x,y:";
  12. for(i=0;i<=1;i++)
  13. cin>>a[i][0];
  14. cout<<"enter the coordinates of x1,y1:";
  15. for(i=0;i<=1;i++)
  16. cin>>b[i][0];
  17. setcolor(CYAN);
  18. line(a[0][0],b[0][0],a[1][0],b[1][0]);
  19. setcolor(WHITE);
  20. cout<<"\n enter the translation coordinates:";
  21. for(i=0;i<=1;i++)
  22. cin>>c[i][0];
  23. for(i=0;i<=1;i++)
  24. {
  25. d[i][0]=a[i][0]+c[i][0];
  26. e[i][0]=b[i][0]+c[i][0];
  27. }
  28. line(d[0][0],e[0][0],d[1][0],e[1][0]);
  29. getch();
  30. closegraph();
  31. }
Add Comment
Please, Sign In to add comment