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.
#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;
}
Comments
Leave a comment