program linije5;
uses crt,graph;
var driver,mode,x1,x2,y1,y2:integer;
begin
  ClrScr;
  write(' Program prikazuje liniju sa zeljenim koordinatama');
  writeln;
  writeln(' Unesi koordinate krajnjih tacaka linije (x1,y1,x2,y2): ');
  readln(x1,y1,x2,y2);
  driver:=detect;
  initgraph(driver,mode,'');
  if (x1<=GetMaxX) and (x2<=GetMaxX) and (x1>=0) and (x2>=0) and
     (y1<=GetMaxY) and (y2<=GetMaxY) and (y1>=0) and (y2>=0)
     then
     begin
       setcolor(white);
       Line(x1,y1,x2,y2);
       readln;
       closegraph
     end
     else
     begin
       restorecrtmode;
       writeln(' X mora biti u intervalu [0,',GetMaxX,'], a Y u intervalu [0,',GetMaxY,']!');
       readln
     end
end.