Search Here

C program to draw Straight Line



/* C program to draw a Straight Line */

#include<graphics.h>
int main()
{
    int gd = DETECT,gm;
    initgraph(&gd,&gm,"c:\\turboc3\\bgi"); /* For Windows Turbo-C */
    //initgraph(&gd,&gm,NULL); /* For LINUX */
    outtextxy(100,30,"Straight line");
    line(50,200,500,90);
    delay(5000);
    closegraph();
    return 0;
}


Straight Line
Output

No comments:

Post a Comment