SUMMER TRAINING Free Tutorials  Go To Your University  Placement Preparation 
Project Based Best Summer Training Courses in Jaipur
Join our Telegram Channel To take free Online Courses
0 like 0 dislike
in GTU B.E. (CSE-I-Sem) Programming For Problem Solving Lab by Goeduhub's Expert (7.1k points)

Define a structure called cricket that will describe the following information:

Player name

Team name

Batting average

Using cricket, declare an array player with 50 elements and write a C program to read the information about all the 50 players and print team wise list containing names of players with their batting average.

1 Answer

0 like 0 dislike
by Goeduhub's Expert (7.1k points)
edited by
Best answer

In this program we are going to implement a structure called cricket which will hold three members as player name, team name, batting average. We will take input of these information from user and then print it to output window.

To learn about structure and union from beginning Click Here.

Example :


//Declaration of structure name cricket
struct cricket{

//Declaration of structure member variables
char player_name[30],team_name[30];
int bat_avg;

void main()
int i,n;

//To store information of as much players as much required
printf("\nEnter the number of players you want to include:");

//To store information of players
printf("\nEnter the following information related to players");
printf("\nPlayer %d Name:",i+1);
printf("\nTeam Name:");
printf("\nBatting average:");

//To print information of players
printf("\nEntered Information:");
printf("\n|| S.No. ||  Player Name      ||    Team Name    ||   Batting Average  ||");
printf("\n||  %d    ||   %s             ||       %s        ||          %d     ||",i+1,player[i].player_name,player[i].team_name,player[i].bat_avg);

Output :

Output of above program showing structure operation

For More GTU C Programming Lab Experiments Click Here

Our Mentors(For AI-ML)

Sharda Godara Chaudhary

Mrs. Sharda Godara Chaudhary

An alumna of MNIT-Jaipur and ACCENTURE, Pune


Ms. Nisha

An alumna of IIT-BHU

Related questions


About Us | Contact Us || Terms & Conditions | Privacy Policy || Youtube Channel || Telegram Channel © Social::   |  |