Created
August 11, 2022 17:45
-
-
Save Dbhardwaj99/2aae798fe44998682d8d88d13cd20bf0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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