Online Courses
Free Tutorials  Go to Your University  Placement Preparation 
Goeduhub's Online Courses @ Udemy in Just INR 570/-
Online Training - Youtube Live Class Link
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.

Goeduhub's Top Online Courses @Udemy

For Indian Students- INR 570/- || For International Students- $12.99/-


Course Name



Tensorflow 2 & Keras:Deep Learning & Artificial Intelligence

Apply Coupon


Natural Language Processing-NLP with Deep Learning in Python Apply Coupon


Computer Vision OpenCV Python | YOLO| Deep Learning in Colab Apply Coupon
    More Courses

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

3.3k questions

7.1k answers


4.5k users

Related questions


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