Skip to content

Instantly share code, notes, and snippets.

@Dbhardwaj99
Created August 11, 2022 17:45
Show Gist options
  • Save Dbhardwaj99/2aae798fe44998682d8d88d13cd20bf0 to your computer and use it in GitHub Desktop.
Save Dbhardwaj99/2aae798fe44998682d8d88d13cd20bf0 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
struct cricket
{
char player_name[11];
char team[2];
float bating_avg;
}
a[50];
void display()
{
for (int i = 0; i < 2; i++)
{
cout << a[i].bating_avg << "\t" << a[i].player_name << a[i].team << endl;
}
}
int main()
{
for (int i = 0; i < 2; i++)
{
cout << "enter player name: \n";
cin >> a[i].player_name;
cout << "enter tean name: \n";
cin >> a[i].team;
cout << "enter batting average of player: \n";
cin >> a[i].bating_avg;
}
display();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment