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
should i put define constant and memory constant in my flowchart? the other one, how to draw flowchart for break and continue statement?

Write a program IdentyfyWordsMain.java reading a fi le (like HistoryOfProgramming) and divide the text into a sequence of words (word=sequence of letters). Save the result in a new

Inline Functions Imagine a c program, which reads disk records having employee information. If this is a payroll application each employee record data is probably processed by


C Program for MULTIPLICATION TABLE   main() {           int a, b=1, c, d;           char ch;           clrscr();           while(ch!='n')           {


A r r a y s w i t h i n a c l a s s: I t i s j u s t d ecl a r i n g o r c on s t ru c ti n g a d e r i v e d t


create a shopping cart in c++

For this program you will add and test 2 new member functions to the IntSLList class posted on the website. The two member functions are: insertByPosn(int el, int pos) Assuming t