C Program to Sort array of Structure


Problem Statement : C Program to sort array of Structure in C Programming

Write a C program to accept records of the different states using array of structures. The structure should contain char state, population, literacy rate, and income. Display the state whose literacy rate is highest and whose income is highest.

Problem to display the highest literate rate and the highest income of a state using array of structures

Output :

Explanation of Program :

Firstly accept total number of states so that we can accept all the details using the for loop.

Now we are checking for the maximum value.

Inside the for loop we are checking the the literacy value with the maximum value.If current literacy rate is greater than the current maximum value then we are modifying the current maximum value.