Question: 2- Write a program to place 10 queens on 10 x 10 chessboard in such a way that one queen is to be in each

2- Write a program to place 10 queens on 10 x 10 chessboard in such a way that one queen is to be in each row. A program will use 2 DIMENIONAL array x[r][c] to do this configuration. If x[r) has value c, then in row r there is a queen in column c. Write a program that asks a user to enter the columns that contain queens in the 10 rows. The program then places the queens in these columns (one per row) and prints the board. For example, if the user enters: 0,3,2,0,0,7,6,7 for 88 board, this means in the first row, the queen will be placed in the first column, in the second the queen will be placed on the fourth column, in the third row, the queen will be placed on the third column and so on. So, based on the above user input, the output will be row, For this code, the user will input the following: 1, 0,7,7,0,3, 2, 6, 8,4 Loop and conditionals should be used otherwise marks will be deducted. Don't hardcode the output otherwise marks will be deducted. The output should be as follow (note: user input is required): Please enter columns to put queen 1 Please enter columns to put queen Please enter columns to put queen 7 Please enter columns to put queen 7 Please enter columns to put queen Please enter columns to put queen 3 Please enter columns to put queen 2 Please enter columns to put queen 6 Please enter columns to put queen 8 Please enter columns to put queen
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
