Chapter+4_Ex+4.29


 * exercise number:**
 * 4.29**


 * description of objective:**

code format="cpp" using namespace std; void gotoxy(int x, int y);                            //declare gotoxy function
 * code:**
 * include
 * 1) include
 * 2) include 

int main(int argc, char *argv[]) {

int size, n;                                          //declare 2 integers, size requires user input. cout<<"What size x would you like (an odd number)? "; cin>>size;                                            //request user's input for the size of the x    for(n=1;n<=size;n++){                                  //make a loop to print the x                         gotoxy(n,n);                      //the left star of each line, but only the cursor location cout<<"*";                       //print the cursor gotoxy(size-n+1,n);              //jump to the second star of each line. the reverse of the first cout<<"*"; }   cin.ignore(100,'\n'); cin.get;

system("PAUSE"); return EXIT_SUCCESS; }

void gotoxy(int x, int y) { COORD coord; coord.X = x;	coord.Y = y;	SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord); }**

code