Draw a picture using line - c program, C/C++ Programming

Draw a picture using line:

void main(void)

{

    int   driver = DETECT,mode;

    int   x[10],y[10];

    int   x_center = 360, y_center = 180, rad = 100;

    int   i,j;

 

    initgraph(&driver,&mode,"c:\\tc\\bgi");

    for ( i = 0; i < 10; i++ )

    {

       x[i] =  x_center + rad *  cos(36*i*3.14159/180);

       y[i] =  y_center + rad *  sin(36*i*3.14159/180);

    }

    for ( i = 0; i < 10; i++ )

       for ( j = 0; j < 10; j++ )

                  line(x[i],y[i],x[j],y[j]);

    getch();           /* press any key return to TEXT mode */

    closegraph();

}

Posted Date: 10/18/2012 6:34:16 AM | Location : United States







Related Discussions:- Draw a picture using line - c program, Assignment Help, Ask Question on Draw a picture using line - c program, Get Answer, Expert's Help, Draw a picture using line - c program Discussions

Write discussion on Draw a picture using line - c program
Your posts are moderated
Related Questions
Node *orderedInsert(Node *p, int newval); /* Allocates a new Node with data value newval and inserts into the ordered list with first node pointer p in such a way that the data va

there is a pebble merchant. he sells the pebbles,that are used for shining the floor.his main duty is to take the length of the room side but he sometines mistakes doing that and m

Employ operator () instead of operator[]. While you have multiple subscripts, the cleanest way to do it is along with operator () instead of with operator[]. The reason is that

I need a project on car rental system using c programming only of college level

This is what I need help with. "Create a program creates an interface allowing the user to select from some other programs I have made one being a money converter and the other ca

Describe what is actual arguments? - When certain functions are created and used to perform an action on some provided values, some values are required to be passed to them. Th

The absolute land-speed record of 763.035 MPH (Mach 1.02) was set in October 15 1997 by a jet-powered car called Thrust SSC in the Black Rock Desert of northern Nevada. The team th

(Random Numbers) Write statements that assign random integers to the variable n in the following ranges: a) 1 ≤ n ≤2 b) 1 ≤ n ≤100 c) 0 ≤ n ≤9 d) 1000 ≤ n ≤1112 e)

Should my constructors employ "assignment" or "initialization lists"?

Program for Memory Optimization of C / OpenCL Code Project Description: This is possibly a very simple project for someone with an excellent knowledge of C and OpenCL. That,