mA, teamB). You need to decide which team is winner by generating score of each player using rand function. Player will be marked as out if he scored 7 on a ball delivery. Use functions to maintain program flow. Guidelines: 1. Use single dimensional array of each team of size three to store the score of players. 2. Create a user defined function of batting_inning (int teamA[3]) to execute the game. Use limit of three to five overs of six ball. Once the batting inning of a team get over, it should aggregate the team score into one variable i.e. team_score.
Write a program that reflect the cricket game by taking input of two teams having three players of each team (i.e. teamA, teamB). You need to decide which team is winner by generating score of each player using rand function. Player will be marked as out if he scored 7 on a ball delivery. Use functions to maintain program flow.
Guidelines:
1. Use single dimensional array of each team of size three to store the score of players.
2. Create a user defined function of batting_inning (int teamA[3]) to execute the game. Use limit of three to five overs of six ball. Once the batting inning of a team get over, it should aggregate the team score into one variable i.e. team_score.
3. Use rand () function to generate random score.
Step by step
Solved in 3 steps with 1 images