Question
write a programe in c language.Remember the tic-tac-toe game, in which 2 players X and O are playing the game on a 3x3 square board
write a programe in c language.Remember the tic-tac-toe game, in which 2 players X and O are playing the game on a 3x3 square board and the player having all his marks on horizontal, vertical, or main diagonal is a winner. You are given a square board (3x3 dimension matrix) having X and O in it. Find whether the player X wins the game or not.
X won: if any of the horizontal row, vertical column, or main diagonal of the board has all marks X in it.
Sample Input (Main diagonal is underlined for your reference) | Sample Output
| |
Matrix: X O X X X O X O O | ---> | Player X wins the game |
Matrix: X O X X X O O O O | ---> | Player X doesnt win the game. |
Matrix: X O X X X O O O X | ---> | Player X doesnt win the game. |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started