ALGORITHM: STEP 1: Define the functions that are to be used. STEP 2: Assign a constant value of 8 to QUEENNO. STEP 3: Call the function placequeen(0, x). STEP 4: Print the message “End”. STEP 5: Stop the program. FUNCTION VOID PLACEQUEEN(int k, int *x) STEP 1: Declare local variables STEP 2: Set a for loop for i. for(i = 0; i < 8; i++) STEP 3: Check for result of function canbeplaced(k, I, x). STEP 4: If it is 1 then assign the value of i to x[k]. x[k] = i; STEP 5: Check if k is equal to 7 if show call the function showboard(x). STEP 6: Read the value of ch from the user. STEP 7: If the value is equal to n or N then exit. STEP 8: Check whether k is less than 7 if so then call the function placequeen(k + 1, x). FUNCTION INT CANBEPLACED(int k, int i, int *x) STEP 1: Declare the local variables. STEP 2: Set a for loop for j. for(j = 0; j < k; j++) STEP 3: Check for the following condition if( (abs(j - k) == abs(x[j] - i) || (x[j] == i) ) ) S...
All HR and Technical interview questions with answers for freshers and experienced professional. It helps job seekers who are about to attend interviews.