traffic light program in c

traffic program in c

Traffic light program in c #include<graphics.h> #include<conio.h> #include<dos.h> #include<stdlib.h> main() { int gd = DETECT, gm, midx, midy; initgraph(&gd, &gm, “C:\\TC\\BGI”); midx = getmaxx()/2; midy = getmaxy()/2; setcolor(RED); settextstyle(SCRIPT_FONT, HORIZ_DIR, 3); settextjustify(CENTER_TEXT, CENTER_TEXT); outtextxy(midx, midy-10, “Traffic Light Simulation”); outtextxy(midx, midy+10, “Press any key to start”); getch(); cleardevice(); setcolor(WHITE); settextstyle(DEFAULT_FONT, HORIZ_DIR, 1); rectangle(midx-30,midy-80,midx+30,midy+80); circle(midx, midy-50, 22); … Read more

C graphics programming

basic graphics program in c

C graphics programming     #include <graphics.h>   #include <conio.h>    int main()   {       int gd = DETECT, gm;      initgraph(&gd, &gm,”C:\\TC\\BGI”);      outtextxy(10, 20, “Graphics programming is fun!”);      circle(200, 200, 50);       setcolor(BLUE);       line(350, 250, 450, 50);       getch();       closegraph( );       return 0;   }