C Program to Sort Structures on the basis of Structure Element

Sorting Two Structures on the basis of any structure element and Display Information

Program Statement – Define a structure called cricket that will describe the following information

  1. Player name
  2. Team name
  3. Batting average

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

Output :

Explanation of C Program :

Step 1 : Accept Data

Step 2 : Sorting two Structures

Using Logic used in bubble sort sort out structure.