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

Why are all header files not declared in every c program, Why are all heade...

Why are all header files not declared in every C program? - Declaring all header files in each program would result in increase in overall file size and load of the program. It

Computes the amount of postage count even or odd, (a) Write a procedure (co...

(a) Write a procedure (count-even n) that counts the number of even digits in the decimal representation of the number n. For example, (count-even 234) should return 2. (b) Writ

Academic expert for genetic algorithm, Academic expert for Genetic Algorith...

Academic expert for Genetic Algorithm Project Description: Seeking academic expert for Genetic Algorithm. Skills required are Academic Writing, Algorithm, C++ Programming,

Optimized nic driver for windows compact 7, Optimized NIC Driver for Window...

Optimized NIC Driver for Windows Compact 7 for Hard Real Time Communication Project Description: I am seeking an optimized driver (miniport driver) that will be used for sele

Call by reference, Call by reference: Arguments to a function can be pa...

Call by reference: Arguments to a function can be passed in two way; one by call by value and other by call by reference.  Call by value is passed either through a constant

Functions, Define  F u n c t i o n?  T h e r e a r e t...

Define  F u n c t i o n?  T h e r e a r e t w o t y p e s o f f u n ct i o n b u i l t - i n f un ct i o n s a n d u

Non-maxima suppression, Use the program called harris-shell.c and add some ...

Use the program called harris-shell.c and add some code to find the corners in the image checkers.jpg. You should say that a pixel in the image is a corner if it passes the given t

C, A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P...

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string of the c

Program simulate a metropolitan subway train, You're going to simulate a me...

You're going to simulate a metropolitan subway train.  The train system will start out at Station #1, or Home  Station, and will service multiple stations along its route.

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