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

Assignment Help:

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();

}


Related Discussions:- Draw a picture using line - c program

Explain member functions of a class, Member Functions of a Class A memb...

Member Functions of a Class A member function of the class is similar as an ordinary function. Its declaration in a class template must explain its return value as well as the

Define storage classes of c program - computer programming, Define Storage ...

Define Storage Classes of c program - computer programming? Each variable and function in C language has two attributes that are type and storage class. If storage class of a v

Define bitwise-and operator, Define Bitwise-AND Operator: &:? The bitwi...

Define Bitwise-AND Operator: &:? The bitwise-AND operator (&) compares every bit of its first operand to the corresponding bit of its second operand. If both bits are 1 the mat

C program to add, C program to add, average and deviation of numbers: v...

C program to add, average and deviation of numbers: void main() {                 int sum=0,a[10],i;                 float avg=0,dev,vari=0,var;                 pri

HASHING, What is meant by open addressing? Explain various collision resolu...

What is meant by open addressing? Explain various collision resolution techniques with example

In p = new fred(), Q: In p = new Fred(), does the Fred memory "leak" if  Fr...

Q: In p = new Fred(), does the Fred memory "leak" if  Fred constructor throws an exception? A: No.         If an exception take place during the Fred constructor of p = new F

When i develop a destructor, When I develop a destructor, do I require to e...

When I develop a destructor, do I require to explicitly call the destructors for my member objects?

Define the double data type of c language, Define the Double Data Type of c...

Define the Double Data Type of c Language? The double is used to define BIG floating point numbers and it reserves twice the storage for the number. When the accuracy provided

Introduction to c programming, How would you print the values of the variab...

How would you print the values of the variables words and lines so they appear in the form: There were 6040 words and 680 lines. Here, 6040 and 680 represent the values of the two

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd