Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

More Books

Students also viewed these Databases questions

Question

5. What information would the team members need?

Answered: 1 week ago

Question

Which team solution is more likely to be pursued and why?

Answered: 1 week ago