hope this helps but the first thing i noticed in this code is the cins within case 1 and case 2:
1 2 3 4 5 6 7 8 9
case 1 and case 2: // you forgot the '>>' for each cin
cout <<endl<<"masukkan variabel x1=";
cin vx1; cout <<endl<<"masukkan variabel x2=";
cin >> vx2;
cout <<endl<<"masukkan variabel y1=";
cin >> vy1;
cout <<endl<<"masukkan variabel y2=";
cin >> vy2;
also would recommend looking on the format options and chosing <> button to put your code like how i did above. Kinda makes it hard to read how you just submitted it as such but np. Also would say take a look at the endl. could be a error in any of those sections that may make the code mess up. The way I was taught about endl was set as cout<<"whatever you want to tell the user"<<endl; or even so it all depends. http://www.cplusplus.com/reference/ostream/endl/
also next question i have to ask is where are you defining kbhit? as well as putpixel and such. Just want to make sure about that. is it associated with your graphics.h?
those are the first things that i noticed that caught my attention but please do explain what issues you have had as well as what you have noticed. cant help if your not detailed ok?