sector function of c graphic

C graphics program to draw sector.
  • General syntax of sector is
    sector(int x,int y,int sangle,int eangle,int xradius,int yradius)
  • Sector is used to draw and fills elliptical pie slice.
  • It takes 6 arguments, all int data tyape.
  • The first two arguments are used to define center of the circle in x and y co-ordinates.
  • Third and fourth arguments are starting and ending angles of the sector.
  • Fifth argument is the radius of the ellipse in x axis and sixth argument is the radius of the ellipse in y axis.
C Program to draw sector

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



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

    sector(150, 150, 10, 145, 95, 85);
    getch();
    closegraph();

    return 0;
}


sector function of c graphics
Download


0 comments:

Post a Comment