bar function of c graphics

C graphics program to draw bar.
  • Syntax to draw a bar is bar(int left,int top,int right,int bottom)
  • Bar is used to draw rectangular bar.
  • It takes 4 arguments, all of the int datatypes.
  • First two arguments are left-top corner of the bar 
  • Last two arguments are right-bottom corner of the bar.

C Graphics program to draw bar.

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



int main( )
{
    int gd=DETECT, gm;
    initgraph(&gd,&gm,"C:\\tc\\bgi");

    bar(100,100,400,300);
    getch();
    closegraph();

    return 0;
}

bar function of c graphics

Download


1 comments: