C doesn't have a graphics library as part of it's specification, so you'll need to be a little more specific than that.

a month later

how can i run c++ graphics code in codeblock or gcc command line ?

    I think I can't explain it properly. so can you please tell me how can I run this code in Linux

    `#include <stdio.h>
    #include <graphics.h>

    int main()
    {
    int gd = DETECT ,gm ,i;
    float x, y, dx,dy,steps;
    int x0,x1,y0,y1;
    printf("Enter the Value of X1, X2, Y1 ,Y2\n");
    scanf("%d\n%d\n%d\n%d",&x0,&x1,&y0,&y1);
    initgraph(&gd,&gm,"");

    dx = (float)(x1-x0);
    dy = (float)(y1-y0);
    if(dx>=dy)
    {
        steps =dx;
    }
    else{
    steps =dy;
    }
    dx = dx/steps;
    dy = dy/steps;
    
    x= x0;
    y=y0;
    i=1;
    while(i<=steps)
    {
        putpixel(x,y,WHITE);
        x+=dx;
        y+=dy;
        i++;
    }
    getch();
    closegraph();
    return 1;

    }
    `