Answer to Question #209646 in C++ for zain ul abdeen

Question #209646

write a c++ program to make cricket game in which we have 2 teams and each team should hy 11 players.boling and bating full detail and we should print it on console no need for gui.


1
Expert's answer
2021-06-22T14:52:25-0400
#include <iostream>

struct cricket {
  std::string player[11];
};

int main()
{
  cricket team1, team2;
  std::cout << "Enter players' names: (team1)\n";
  for (int i = 0; i < 11; i++) {
    std::cin >> team1.player[i];
  }
  std::cout << "Enter players' names: (team2)\n";
  for (int i = 0; i < 11; i++) {
    std::cin >> team2.player[i];
  }
  std::cout << "TEAM-1" std::endl;
  for(int i=0; i<11; i++)
    std::cout << team1.player[i] << std::endl;
  std::cout << "TEAM-2" std::endl;
  for(int i=0; i<11; i++)
    std::cout << team2.player[i] << std::endl;
  return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS