Thread: Can someone tell me how to put this Array into Columns of 4! pleaseeee

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    15

    Can someone tell me how to put this Array into Columns of 4! pleaseeee

    okay here is my function definition
    Code:
    void myPrint(int x[], int size)
    {
    	int i;
    	
    
    
    	for(i=0; i < size; i++)
    	{
    		
    			printf("%d", x[i]);
    		printf("\n");
    		
    	}
    		
    
    	
    }
    if i scanned in integers in an array[100] into myList[size] size being how many integers were entered...can you tell me what i can do to my function definition so that it will print out the entries so that it will print them out 4 entries a row.

  2. #2
    Make Fortran great again
    Join Date
    Sep 2009
    Posts
    1,413
    Try changing the for loop step to 4 and changing what you do inside of that for loop...

  3. #3
    Registered User
    Join Date
    Sep 2009
    Location
    USA
    Posts
    63
    Quote Originally Posted by Ol_denjin View Post
    okay here is my function definition
    Code:
    void myPrint(int x[], int size)
    {
    	int i;
    	
    
    
    	for(i=0; i < size; i++)
    	{
    			printf("%d", x[i]);
    		printf("\n");
    		
    	}
    		
    
    	
    }
    if i scanned in integers in an array[100] into myList[size] size being how many integers were entered...can you tell me what i can do to my function definition so that it will print out the entries so that it will print them out 4 entries a row.
    I remeber doing a similar project where i used if loops thus defeining how to make the

    array to print out

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. put number in array
    By nevrax in forum C Programming
    Replies: 26
    Last Post: 03-27-2007, 04:20 PM
  2. Addition of the rows and columns in an array.
    By Turtal in forum C Programming
    Replies: 4
    Last Post: 11-14-2006, 09:00 PM
  3. 2d array question
    By gmanUK in forum C Programming
    Replies: 2
    Last Post: 04-21-2006, 12:20 PM
  4. question about multidimensional arrays
    By richdb in forum C Programming
    Replies: 22
    Last Post: 02-26-2006, 09:51 AM
  5. Hi, could someone help me with arrays?
    By goodn in forum C Programming
    Replies: 20
    Last Post: 10-18-2001, 09:48 AM