Tic Tac Toe Game Uses Printf Puts Scanf Use Cin Cout Q37241176

Tic Tac Toe Game
only uses printf, puts, and scanf (do not use cin orcout<<endl because my cp cannot read it)
player vs computer
computer always win
no more than 500 lines.

thank you
C program


Answer


`Hey,

Note: Brother in case of any queries, just comment inbox I would be very happy to assist all your queries

#include <stdio.h>

char square[10] = { ‘o’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’,’9′ };

int checkwin();
void board();

int main()
{
int player = 1, i, choice;

char mark;
do
{
board();
player = (player % 2) ? 1 : 2;

printf(“Player %d, enter a number: “, player);
scanf(“%d”, &choice);

mark = (player == 1) ? ‘X’ : ‘O’;

if (choice

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.