1 #include<graphics.h> 2 #include<conio.h> 3 int main() 4 { 5 initgraph(640,480); 6 for(int y=100;y<=300;) 7 { 8 if(y/10%2==1) 9 setcolor(RGB(0,0,255)); 10 else 11 setcolor(RGB(255,0,0)); 12 line(100,y,300,y); 13 y+=10; 14 } 15 getch(); 16 closegraph(); 17 }