i ran this on my machine,u can skip the gotoxy part,but it should print out a line of *'s without the gotoxy.Code:#include<stdio.h> #include<conio.h> #include<stdlib.h> #include <windows.h> void gotoxy(int x, int y) { COORD coord; coord.X = x; coord.Y = y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord); } void drawImage( int image[], int size, int side, int even) { int r, c; //loop through the image setting the appropriate pixels to "white" if the square is present for (r = 0; r < size; r++) { for (c = 0; c < size; c++) { if ((size/2 - side/2) > r || (size/2 + side/2 - even) < r ) { //Leaves the value of the array as it is since no part of the image appears in this row } else if( (size/2 - side/2) > c || (size/2 + side/2 - even) < c ) { //Leaves the value of the array as it is since no part of the image appears in these columns } else { image[r+c*size] = 1; } } } } printimage(int image[],int size) { int r,c; for (r = 0; r < size; r++) { for (c = 0; c < size; c++) { if((image[r+c*size])==1) {gotoxy(r,c); printf("*");} } } } main(){ int r; int image[25*25]; for(r=0;r<625;r++) { image[r]=0; } int size =25; int side =10; int even =1; drawImage(image,size,side,even); printimage(image,size); }