0

Hello I need help with a C program that I solves Sudoku puzzle. I am suppose to write two functions one to populate the arrays from the user input. This function should take as parameters the arrays to fill.Second function to print the 9 by9 array passed to it.This function
should also add extra space between neighboring 3 by 3 subgrid. I have already written this function and I have started on other function. In this program the user should enter the starting
values of the puzzle. A zero is entered for squares with no initial value.

#include <stdio.h>
#include <stdlib.h>
#define ARRAY_SIZE  (81)
#define ROW (9)
#define COLUMN (9)

void PopulateArray(int A[i]);
void PrintArray(const int A[]);


void PopulateArray( int A[])
{
 printf("Enter row 1(seperate values with a space\n")
 printf("Enter row 2(seperate values with a space\n")
 printf("Enter row 3(seperate values with a space\n")
 printf("Enter row 4(seperate values with a space\n")
 printf("Enter row 5(seperate values with a space\n")
 printf("Enter row 6(seperate values with a space\n")
 printf("Enter row 7(seperate values with a space\n")
 printf("Enter row 8(seperate values with a space\n")
 printf("Enter row 9(seperate values with a space\n")
}


void PrintArray(const int A[])
{
   int i 
   
   for(i=; j <  ARRAY_SIZE;j++)
   {
     if(j % 9 == 0)
      {
        printf("\n");
      }
     
     printf("%2d",A[j]);
   }    
}  
   

   





}



 
 printf("Enter row 1(seperate values with a space\n", int A[i]):
 printf("Enter row 2(seperate values with a space\n"):
 printf("Enter row 3(seperate values with a space\n"):
 printf("Enter row 4(seperate values with a space\n"):
 printf("Enter row 5(seperate values with a space\n"):
 printf("Enter row 6(seperate values with a space\n"):
 printf("Enter row 7(seperate values with a space\n"):
 printf("Enter row 8(seperate values with a space\n"):
 printf("Enter row 9(seperate values with a space\n"):
 




int main(void)
{
 PopulateArray();
 PrintArray();

 system("PAUSE");
 
 return 0;

}
2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Ancient Dragon
0

What is the question -- I didn't see one ? If that is really the code you have written then its wrong. Line 48 is an extraneous brace and lines 53 thru 61 need to be inside some function.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.