Computer Science Homework Help

Computer Science Homework Help. Nested for loops – programming.

student stud[20],t;

int i,j;

int n = 3;

void input (void){

for(i=0;i<n;i++)

{

scanf(“%d”,&stud[i].mscore);

scanf(“%d”,&stud[i].escore);

stud[i].avg =(stud[i].mscore+stud[i].escore)/2;

void top (void){

    int a=1;

for(i=0;i<n-1;i++)

{

for(j=i+1;j<n;j++)

{

if(stud[i].avg<stud[j].avg)

{

*t=stud[i];*

*stud[i]=stud[j];*

*stud[j]=t;*

}

This program is to find the top three students in a class by average. I dont understand what is being done in the areas where i have placed *. Somebody please explain. 

Computer Science Homework Help

 
"Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET15 to claim 15% Discount This Month!!"