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
A: No. There is nothing you can do in C++ which you cannot do in C. In spite of everything

solve for radius(R) of a circle of its area is to be inputted by a user. also display compute the circle diameter hint: area= pir21 pi=2.1416

Protected derivation In addition to doing private and public derivations, you may also do a protected derivation. In this situation :   The private members inherited

volume of a sphere

i want software to calculate heating or use thermodynamic equation , pleas help me

Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. If the given

Write an algorithm for multiplication of two sparse matrices using Linked Lists.

The program must use the file named on the command line as its input file. Suppose the program is named pdbtool. Then if the user types pdbtool 1A36.pdb the program must read the d

Project Description: I want a script for an online poker site. It needs to be scanning all the required tables and when the table meets certain criteria it should take a seat at

submitting solutions in C language should not use functions from / as these files do not exist in gcc