This is an example of a two-player game in C, along with code to calculate and demonstrate its Nash equilibrium.
In this example, we define a two-player game with payoffs given by the player1_payoff and player2_payoff matrices. We then define a function calculate_nash_equilibrium that calculates the Nash equilibrium of the game. This function iterates over each row of player1_payoff and finds the maximum payoff for player 1 in that row. If the maximum payoff is unique (i.e., there is only one column where player 1 receives the maximum payoff), then that row and column define a Nash equilibrium.
In the main function, we print out the payoffs for each player and then call calculate_nash_equilibrium to calculate and print the Nash equilibrium.
Note that this example game has a unique Nash equilibrium at (2,2), where both players choose the second option.