0 like 0 dislike
1.7k views

Write a program with following requirements:

  • Define the structure type student with fields: name, code, and grade.
  • Write a function to sort the structures in grade ascending order and another function to display the data of the students who got a higher grade than the average grade of all students. If there is only 1 student in the list, display the data of that student.
  • Write a program that uses this type to read the data of 100 students and store them in an array of such structures. If the user enters the grade −1, the insertion of student data should terminate. Then print the data of the students who got a higher grade than the average grade of all students. 

 Example input:

Edgar
20161123
78
Robert
20161523
75
Rebecca
20166123
66
Todd
20161673
86
End
1
-1

Example output:

Students who got a higher grade than the average grade of all students:
Name: Edgar
Code: 20161123
Grade: 78
Name: Todd
Code: 20161673
Grade: 86

 

[Exercise] Coding (C) - asked in C
ID: 23560 - Available when: Unlimited - Due to: Unlimited
| 1.7k views
0 1
Called for Help
0 0
Called for Help
0 0
Called for Help

64 Answers

0 like 0 dislike
Hidden content!
#include <stdio.h>



struct student

{

char name[10];

int code;

int grade;



};





int average(struct student s[], int k)

{
* * * * * * * ** i;
******* ** * * * sum=0;
* * * * ** ** *** * ** ave;
*** *** * ** ** * * *** * *** **
* * * * * ** ** * *
** **** ** * * ** * * * * ******* * * ** * * * * * * ** * **
* ** * * *** * * * ** *** * * *** **** ** **** * ** = %d\n",sum);
* ****** * * * ** * *
* * * ******** * * * ** **
* * * * * * **** ** * ave;

}



void sort(struct student s[],int k)

{
**** ** * * * ** * * i,j;
* ** * *********** ** *** = %d\n",k);
** * * * *** ** * ** * student temp;
** *** ** ***** * * ** * ** * *
* ** * * * *** **
* * *** *** ** ** * * * * ** ** **** ** **** *****
********* * * * ** * * ** **** * * ** ** *
* * * * * ***** * * ******* * * ** ******* ** * * ***** ** ** * ** * ****** * * * * * ***
** * ***** ** * ** * * ** ** *** * * ** ** * * * * **
* * ** * ** * **** * * *** * ** ** ** **** * * * ** * * * ** * *** * * ** * ***** *
** ** ** *** ***** * *** ** * * *** * * ** **** ***** ** ** ****** * * * * *
*** * ****** * ** * * ** * * **** ****** * * *** * * ** * * *** *** ** * ** * * * * *** * *
** *** ** * *** ** * ** *** **** ** ** **** * ** ** **
**** *** ** * *** * ** * * * *** * ** * * *
* * * * * * *

}





int main()

{

int i,k;

int ave;



struct student s[100];



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

{
** ** ** ** *** * **** * ** * * * ** ***
* *** *** ** ****** * * ** **** * * * ** *
*** ** **** * ** ** * ** ** * ** ** ******* ** *
* ******** *** ***** * * * == -1)
** ** ** * *** * ** * ** ** ** ***** * ****

}

k=i;

//printf("k=%d\n",k);

sort(s, k);

ave=average(s,k);

printf("Students who got a higher grade than the average grade of all students:");



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

{
**** * *** * *** ** *** ** ***** * *
* ** * * ** *
*** * **** ***** * * * ** ** ** *** **** ********* * %s\n",s[i].name);
* ***** ** *** ** * * **** * * ********* * ***** * %d\n",s[i].code);
* * ** * * *** ** * ********** ********** * * ** ***** %d",s[i].grade);
*** **** * *** * * **

}

return 0;

}
answered by (-226 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>



struct student

{

char name[10];

int code;

int grade;



};





int average(struct student s[], int k)

{
* * *** *** ** ** ** *** ** i;
*** ** ****** * * **** * sum=0;
* * * ** **** *** ave;
* ** ***** * * * * * * * * * *** **
* * * * * * * ** * * * *
* ** ** * *** * ** * * ** * * * **** ** * * *
* * ** * * **** *** * ** * * * * * ** * *** ** *** *** * * = %d\n",sum);
** * ** ** ** * * *
* ****** ** ** * * * * * * ***
* *** * ** * ** ** * * * ave;

}



void sort(struct student s[],int k)

{
* * ****** * * ** * i,j;
*** * * ** * * * * * * * *** * * = %d\n",k);
******** * * * ** * * ** student temp;
** * ** **** * * ** ** * *
***** * ** *** ** *
* * ** *** ** ** * * * * * ** * * **** * * * ** * *
*** *** * *** * *** ******* *** * *** * * ** ****
** ** ** * * ** ** ** * * * **** ** ** * ** * * *** * ** * * *** *** *
* ********* * * * ** ** *** *** * *** * *
** ** * * * **** ** ** **** ** * *** *** * * * **** * * **** **** * ** * * * ** ******
**** ** * ** ** * ** * **** **** * ***** ** * * ** *** * * ** ** ******* ** ** *** * * ** *
** * ** ** *** ** * * ******** ** * ** * * * * * ** ** ** * * ********* *** * ** **** * ** ****** * **
* * * ****** *** * * **** * * *** * ** * * ** ** * **
* * ** ******* * * ** *** * ***** * **** ***
* ** * ** * ** * ******

}





int main()

{

int i,k;

int ave;



struct student s[100];



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

{
* * * ** ** * *** * ** ** * *** ** ** *
** ** * *** * * ** * * **** * ***** ****** *****
* *** * * **** * * ****** * * * *** * * ******
**** ***** *** ** * * == -1)
* * *** ** ** * *** ** * **** * * * * ********

}

k=i;

//printf("k=%d\n",k);

sort(s, k);

ave=average(s,k);

printf("Students who got a higher grade than the average grade of all students:");



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

{
*** * *** * ** ** * ** * * *** **
* * * *** * * ** *** ****
* ** ** * * ** * ** ** * * * *** * **** **** * * **** %s\n",s[i].name);
* * * * ** * * * ** * ** * * ****** *** *** * * *** ** ** %d\n",s[i].code);
* ** ** ** ** *** *** * *** **** * ** *** * *** *** * %d",s[i].grade);
** * * *** **** **** *

}

return 0;

}
answered by (-226 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>



struct student

{

char name[10];

int code;

int grade;



};





int average(struct student s[], int k)

{
*** * * *** *** ** * * * i;
* ** * *** * **** sum=0;
* * ** * ** *** * ** *** ave;
**** *** * * * * *** *** ** *** *
** * * * * * **
****** * *** * * ***** * ** * * ** *** * ***** *** ** *** *
* ***** ** *** * * * * ** ***** * ** * ** ** * = %d\n",sum);
***** **** ** * * ** *****
* * * ** * * ** **** *
** *** * ** *** ** **** ave;

}



void sort(struct student s[],int k)

{
**** ** * ** **** * * i,j;
* * * * * * ****** * ** * * **** = %d\n",k);
**** ** ** ** ** ** * * student temp;
* * * ** * * ** ** * * * * *
* ** * * ** * *
* * ** * *** ****** * * ** ** * * * *** ***** ** *
* ** *** * * *** * **** ** * *** **
* * ** * * * * ******** * * ** * *** ** * * * * *** * ** *** *** * ** *
**** * * * ** ** * * * ****** ** * * * *** * * * **** * *
** ** ** * * * **** **** ** *** * ** * * * * ** **** * * ** ** *** **** ** ***** * * *** * *
** ** ** ** ** * ** ** ****** * ** * ****** **** *** * ** * * ***** * ** ** ** * *** * *** * **
* * **** * ** *** * ** * * ** * * * ***** ** ** *** * ** * * ** ** ** *
* * * ** ** * ** * * ** * * * * * * ******* ** *******
** * ** * **** * * * ** * ** ** * *
**** *** * ** * ** * * *

}





int main()

{

int i,k;

int ave;



struct student s[100];



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

{
* * * ** * ** *** * *** * ** ** * ***** * *
** ** * ** * * ** ****** * **** * ********* ** **
** ** * ** ** * ******* ** * * * ** *
* **** * * * * *** *** *** == -1)
****** ** * * ** * * * **** ** ** *** * ** *

}

k=i;

//printf("k=%d\n",k);

sort(s, k);

ave=average(s,k);

printf("Students who got a higher grade than the average grade of all students:");



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

{
** * * *** *** ** * * *** ** * ** *
** * * ** * *** *
* ** * * * * * ** ** ** ****** ** ** ** *** *** ** * %s\n",s[i].name);
** * *** ** ** * * * ** * * ** ****** *** * %d\n",s[i].code);
* * **** * * ** * * * * *** * * * * * * * ** ***** *** ** %d",s[i].grade);
** ** **** ** *

}

return 0;

}
answered by (-226 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>



struct student

{

char name[10];

int code;

int grade;



};





int average(struct student s[], int k)

{
** *** ***** ** ** ** * *** i;
* ***** * * * *** * ** * * sum=0;
** * ** *** * ** *** * ave;
*** * * ** ** * * ***** *** * * ***
* * **** ** * * * * *
* * * * * ***** *** ****** * ** *** ** *** *** ** ** * *
* * * **** * * **** * ** ** ** *** ** ** ** * ** * ** * * = %d\n",sum);
* **** ** * **** * * * ** *
** **** ** * * * *
****** *** * * * * * ave;

}



void sort(struct student s[],int k)

{
*** ** * * * *** ** i,j;
* * ** * **** * * ** ** ***** * = %d\n",k);
** * ** * * * * *** student temp;
*** *** * ** * ** * **** *
** ** **** ** ***** *
*** * ** *** * **** ** **** ** * ** * *** ** * *** ****
* ** ** * ******* * *** * ***** ** *
* ***** ****** * * * ** * * ***** **** * * ** ** *** ** ** * ** *** **
** ** ** * ** **** * *** **** ** *** ***** *** * ** * * *
* *** * * * **** * ** * ** ** * ** * ** ** * ***** *** * *** *** ** * * ** * ***** ** * *** * *
* * * ** * * * * * * ** * * *** * * *** *** ** * * ** * *** * ** ****** * * * * ****
* * * **** ** *** ** *** *** *** * ** *** *** ** * * * * *** * ** **** ** * * ** * ** **** *
* ** * ** ** ** *** ** *** *** ***** ***** * *** ** * **
* ** **** *** *** * *** * ** * ****** ** * ** ****
*** ***** ** ** ** *

}





int main()

{

int i,k;

int ave;



struct student s[100];



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

{
* * ** * ***** * * * * * *** * * ** ** * **
** * **** *** * ** * * * * * * ** * ** * * * * * ** *
* * * * * ** ** ***** *** ** * * ** *
** * ********* **** * **** * **** ** == -1)
** * * * ***** * **** ** ******** * ** * *** ** * * *

}

k=i;

//printf("k=%d\n",k);

sort(s, k);

ave=average(s,k);

printf("Students who got a higher grade than the average grade of all students:\n");



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

{
**** ** ** ******** ***** * * *** *
***** * * * ** * * ****
* ** ** ** * * ** ** * * * * * * ** * ** * * * * * %s\n",s[i].name);
* *** **** * ** * * ** ** * * * * * ** *** * ** *** * %d\n",s[i].code);
*** *** * * * **** * ** ** * * * **** **** %d\n",s[i].grade);
** * ** * **** ** * *

}

return 0;

}
answered by (-226 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<string.h>



struct inform

{
*** * * * ***** ** *** name[100];
** ****** ** ** * * * ID;
***** **** * **** grade;

};



void bubble(struct inform stu[],int n)

{
** * ** * * * ** * * inform QQ={0,0,0};

    int i,j;
* ****** ***** * * * * * ****

    {
** *** * ** * * * * ** * * * * * ** *
* * * * ****** ** * *** ** ** * ** * ***
* **** * * *** * * **** * ** * * *** *** ** * * ********** *
*** * * *** * *** * * * *** ** ** * **** ** ** * ** * * * ****
* ** * ** *** *** ******* * ** * * ** * * * *** ** * ** * ** * **** ** * *
* **** ** * *** ** * *** ** *** ** * ** * ** * ** * * ** *** * * * ***
* * **** * **** *** ** * * * ** ** ** ** ** ** * * * ** * * * *** * ** * * * * *
* * * * * * * * * ** * * ** ******* ** * *** ** *** * * * * * * **** *** * * *
** *** * ** ** * ** *** * ********* ****** * * ***** ** ********* ** *** ** ** *** ** * ** **** ** = stu[i+1];
**** *** ** *** ** ** ** *** * * *** ** ** * * * * ***** * * *** **** **** * ***** ***** *
**** * * * * * ** * * * *** *** * * * ** ** *** ** *** * ** * ** *** ** ***** **** * * ****
******* ** *** * ** * *** * * * * * **** **** * **** ** * *** * ****** * ****** * * * **** ***
** * *** ******* ***** * ******* * ** * *

    }
*** * *** ** * * ** stu[]];



}



void select(struct inform stu[],int n)

{
* * *** ** ****** * ** * sum=0;

    int i;
* * ** ****** *** ** * * *** * * ***

    {
*** * * *** ************ ** * * *** * *

    }
** ***** * ** * * *** * * * average=sum/n;






* * ** * * *** * *** * ******* who got a higher grade than the average grade of all students:\n");


** * * * **** ** ***** *** * **

    {
* **** ** * **** * *** ** * *** * ** ** **** *** * *
***** ** * ** ** * ** *** ** * ***
*** ** * ** * * * * ** *** * * *** ***** ** * * * ** * ** *** * %s\n",stu[i].name);
* ** * *** * * ** * ** * *** * * ** * *** ** ** * * ** ** %d\n",stu[i].ID);
* * * **** * * * *** *** * * * *** ********* *** *** * ** ** * * ** ** * * %d\n",stu[i].grade);
*** * ** ** * * * * ***** * **** * * **



    }

}

int main(void)

 {
* ******* * ** ** *** ** inform stu[100];

    int n=0;
* ** * * * ** * * ** *** ** * **
* **** *** * *** ** ** ** ** * ** **** ** * *
* * * * ** * ** ***** *** * * ** * * * ** * **
* *** * ** * * * **** ** *

    {
***** ** ** ** * *** ** * **** * *** * * ****
* ******* ** * ***** *** * * * ** * * ***** * ******** **
* ** * * ** ** ** ****** * * *** ** ** * ** * **** ** * ** * * *** *
** ***** * **** *** ** ** * ** ** *** ** ***** * * * *

    }


***** ** ** * * *** * * * *
** * * ** * * * * *** ** * *

 }
answered by (-412 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include <string.h>



struct student

{
**** * * * * ** **** * * * name[10];
** ***** * * * ** *** ** code;
** * * ** * *** * * ** * grade;

};



int main()

{
** ** * ***** * * * * ** student s[100], ss[100], c;
** ***** ** ** * * i, j, k, a, b;
* ** * * * * * * * ** avg=0.0;
** * ** ** *** *** ** * i<100; i++)
*** **** ** * * * *
** * **** * ** * ** **** * * ** * ** * ** **** **** * s[i].name);
*** *** * * * * * *** * * *** * ** *** **** * * ****** * * * &s[i].code);
* *** ** * * * ** * **** * * *** * * ** * * ** *** &s[i].grade);


**** ***** *** * ** * * * * * *** ** * ****** *** ** * == -1) break;
*** **** ****** ** ** ** * *** **** ** * ** * ** = avg + s[i].grade;


** * *** *** ** **** * *
**** * * *** * ** * * *** * * avg = avg/i;
** **** * * ** * ** * * k=0; j<i; j++)
** **** * *** * ** * **
* *** ** * * * * ** **** *** * ** * * ** * > avg)
* * * * * * ** ****** * * * * ** ** ** * ** * = s[j];
** ** ** * * ** ** **** * * * * * * * * *
******* ** * *** * *
** **** * * * ** * * ** * * a<k; a++)
*** * * * ** * ** * *
****** *** * * * *** ********** * *** ** *** * * * b<k; b++)
** ** *** * ** ** ** * ** * * *** ** * ** * * ** ** * ** * **** ** * * ** > ss[b].grade)
* * ** * ** *** ** * ** * ** **** ** ** * * ** ** * ** ***
* ** * ** ** ** **** * * * *** ** ** * ** * *** * * ** ** *** **** * * *** * = ss[a];
* ** ** * * ** * * ** * ** * * ** * * * * * * * ** * **** *** * * ** ** ** **** = ss[b];
*** *** ** * **** * * ** * * * * * **** *** * * * * ** * * * * * * * ******** *** ** * = c;
***** * ** * ** ** * ** ** ** * ** *** * * * * **** * ** * * ** **

    }


** ** * ** * * ** * * * * ** * * who got a higher grade than the average grade of all students:\n");
* *** * *** * ** **** i<k; i++)
* **** ** ** * * ** **** *
* * ** ** * ** * ** * *** ** *** ** * * ******* %s\n", ss[i].name);
* * **** ** * ****** **** *** ********** * *** * ** * %d\n", ss[i].code);
** ** * *** * * ***** * **** * * ** **** * * ** * * * %d\n", ss[i].grade);
*** * * **** * **


** ***** * * *** * * ** 0;

}
answered by (-364 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include <string.h>



struct student

{
**** * * * ** * * name[10];
** * ** * ** ** * ** code;
* ******** ** ** ** grade;

};



int main()

{
* * * **** * ** student s[100], ss[100], c;
** ******** * *** ** i, j, k, a, b;
* * * * * ** * * *** ** * avg=0.0;
** * *** * * *** * * i<100; i++)
**** * ** *** ****** * *
* ** ** ***** * * ** * * * *** *** * * * * * ** **** *** s[i].name);
* * * * **** * ** *** * * * ** **** * * * ***** * &s[i].code);
** *** ** ***** **** **** * **** * * **** ** * * * * ***** *** * * ** &s[i].grade);


**** **** ** * * **** * * ** ** **** * * ** ** == -1) break;
***** * *** * * * ** ** **** * * ** ** * * * * = avg + s[i].grade;


*** ** * *** * ** **
* * **** * * *** ****** ********* avg = avg/i;
** * ** * * * **** * * * k=0; j<i+1; j++)
** * * ** ** *
* ** ** **** * ** ** * * * * ***** * * * ** > avg)
*** * * *** *** * * ** * ** ** ** * * * = s[j];
* * * * ** * ***** ** * * **** ***** * * *
* * * **** * **
* ** * *** *** * *** * *** a<k; a++)
* * * * ** * * **
** ** ** * ****** * ** ** * * * ** * * b<k; b++)
*** ** * * * ** ** ****** *** ** *** **** * *** *** *** * * ** * * ** > ss[b].grade)
**** ***** **** * * ** * ******* *** * ** * ** * ** * ** * ***** ** **
**** **** * ** * * * ** * ** * ** * * ** *** *** * ** * * ** ** * * * ***** = ss[a];
* ** * * **** ** * * ** * * *** * *** * * * ** * *** ** ** * * **** * *** * = ss[b];
* ** * * * ** ** *** ** ** * ** **** ** **** *** * *** *** * * * * ** *** *** * * *** * = c;
**** * * * *** * ** *** ** **** *** ********** ** ** ** * *** *** ** **

    }


* ****** * * * *** * * ** * **** who got a higher grade than the average grade of all students:\n");
* ** * **** ** * * **** * i<k; i++)
** *** * *** * * ***
* * ** * *********** ** * **** ** ** * **** ** ** * ** %s\n", ss[i].name);
* ** * *** * ****** **** ** * * * *** * *** *** * %d\n", ss[i].code);
* * ***** * * *** **** *** * **** * * * * %d\n", ss[i].grade);
*** ** ** ** * ** *


** ** ***** * ** * * * 0;
answered by (-364 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<string.h>



struct inform

{
* ** * * ** * name[100];

    int ID;
** * * * ** * * * *** ** grade;

};



void bubble(struct inform stu[],int n)

{
** **** * ** * * ** * * inform QQ={0,0,0};
* * *** * ** **** * * * i,j;
* **** ****** **** * * * *** * * * *

    {
* * *** * ** * * ** * * * *** * * ********** * * * ** **
** ** *** * * * **** *** ******* * ***** * *
* * * * * ** ***** * * *** * ** ** * *** * *** * * * * **** * ** *** ** **
* * * ** *** ** * * **** ** ***** * * * ** * * **** **** ** ****
* * * ** *** * * *** ** * * * *** *** *** * * ** *** * **** * * * * * * ** **** *** *
* * ** * ***** *** * ** ** *** * * * * ** * * * * * * ** ** * * *
** ****** ** * **** * * *** * * ** ** * ** * **** * **** * * * * ** * * * **** *
** * * * *** * * * * *** *** * ** ** * **** * *** * *** * * * * * *** ***
* * * * ***** ** ***** * * * ** * * * ***** ** * ** *** * * ** * ** * * **** * * * ** ** * * ****** * * = stu[i+1];
* * *** *** * * **** ***** * * *** ** ** *** ** * * * * * * ** * ** ****** ** *** * * **
** * * *** ****** *** ** ** * * ** * *** ** * ** *** * ** ** * * * * ** * ** *** ****** ** **
** * * * *** *** **** * ***** * *** ** * ** * ** ** * * ** ** ****** * * **
** *** * *** *** ******** * ** * * **** * *

    }
* ** * * * ** ** * * * ** stu[]];



}



void select(struct inform stu[],int n)

{
** * *** * ** ** * * *** sum=0;

    int i;
* ** * ** * ** ** * ** ** ***

    {
* * ** ** ** * *** * * * * ** * * ***********

    }
* * * ** ** ** *** * * * average=sum/n;






* * *** *** ** * * ** * * * * ** who got a higher grade than the average grade of all students:\n");
** ** * **** *** * *** ** **

    {
* * * ** **** ***** * ***** * ** ** ** *** ** * * * * * ** **
* **** * ** ** * ** ** * **
* *** ***** **** ** * ** ** ***** * ** * ** * ** ** ** * ** * * * * * * **** * * %s\n",stu[i].name);
** *** ** * ** * * * * **** ** ** * *** ** * ** * * ** ** *** * * *** * %d\n",stu[i].ID);
**** ** ** ***** * * * ** ** * ** * * * * ** **** * ** ** ****** * * *** ** *** %d",stu[i].grade);
* * * *** * **** ** ** ** ** *** * * * *



    }

}

int main(void)

 {
**** ***** ** **** ** *** inform stu[100];

    int n=0;
* * ** * **** * * **** **** * ** **
**** * * * ** * * ** * *** * * ** * ** * * ** * **
** ** *** ********* * * ** * * * * * * *
*** * ** *** *** * *** *** *** ** *

    {
*** *** * * *** * * * ** *** ** *** * ** ** **
** * * ** ** * ** ** * *** ****** * ** * * **** ** * * * ** * * **
* * * * * * *** ***** * ***** ** * ** ** ** * * ** *** ** *
*** ** **** * * ** *** * *** * ** ** *** *** ** * *** * * *

    }
*** ****** * *** *** *
* * *** * ** * * ******** *

 }
answered by (-412 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include <stdlib.h>



typedef struct classA{

    char name[50];

    int code;

    int grade;

}student;



int main(){

    int n;

    student list[100];

    while(1){
* ****** * * * * **** ** * * ** * * ** ** * i;

        int stu=0;
* ** * ** ** * * *** * * * ** ** * ***** * * * gradesum = 0;
** * * ** ** ** ** *** ** * *** ** ** * r;
****** ** * ***** ** ** **** * * * * *** * * * *** * * *
* * **** ** * * **** * *** *** * ** ** ** * ** * ** ** ** * ** * ** * *** * ** ***
* ** * *** ** *** ** * *** **** *** * * *** * ** ***** * * ** ** *** * * **** **** *** * *** * *** *
**** * * * * * * * ** ** ** **** * ** **** *** * * **** * * * * **** * * * * ** * *
* * ** * * ** **** * * * ** * *** ** ** *** ** *** * = stu + 1;
** ** ** ** * * ** * *** ****** * * ** ** * ** * * **** * ** * * **** *****
* **** ** * **** *** ****** * * ** * *** ** *** * * * * * * * **** ** * ** ** ******* **
* ** * *** * * * *** * *** * **** * *** ** * ** ** ** * * ** ** ** * * * ** *** * **** ***** = gradesum + list[i].grade;
*** * **** *** ** * **** ***** * ****** * * * *
*** * ** *** * ***** ***** **** *** * * ** *** ** * ** * * ** ** * * * * * * = gradesum/(stu-1);


*** *** *** * *** *** ******* *** ** ** * * ******* * * ** ***** *** * * * * * ** ** * * ** *** who got a higher grade than the average grade of all students:\n");
*** * **** * * ** * ****** ** ** ** *** ** ** * **** ** * *** * * *** ** * ** ***** *** * * *
* * * **** * * * * * ** *** ***** * * ** * ***** * ** ****** ** * * * * ** ****** * *** *** * ** * * ***** ** ** * > r){
** *** * * ** ***** ** **** *** * * * **** ** * ** * ** * * * ** **** * ** * *** ******** * **** ** * ** * * ******** ** * * *** * * * * ** %s\nCode: %d\nGrade: %d\n",list[i].name,list[i].code,list[i].grade);
* * ** *** * *** * * ** ** * * ** *** * * ** **** * * * * * ** ****** * *** ***** * ***
** *** * * ** ****** ** * * * * ***** * ** * * *** **** * * ** * **** * **** ***** *
* * ***** ** ** *** *** ***** * * * * * * * * * * * * * * ** ****** * ** * * * * *** ** ***
* ** * *** * *** ****** * ** *** * ** ** ** *** * * **** * *** *** ** 0;   
*** *** * * ** * * ** * * ** * ** * * * ** ** *** * *** * *** ***** * ** ** * ***
** * ** * * ** **** ** *** * ** * **** ** * * ** ** * * ** * * * *

* ** ** * * *** * *** ***** * * * * * **** ** * * * ** *** ** *** * ** * *** * *** ** ** * ** * ** * * ** * * * ** **** ** * *
* * ** *** **** * * * * * * ** ** ****** * ** ** ** * *   

    return 0;   

}
answered by (-136 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<stdlib.h>

typedef struct StdList{
*** *** * * * * ** name[100];

    int stdnumber[100];

    int score;

}u;

int PrintList(int i,struct StdList people[]){
* ** * * * * ****** * * t=0,s=0,change[100]={0};
*** * * * ****** * * ave=0;
* * **** * * * ** * * * ** j=0;j<i;j++){
* ** ** * **** ** *** **** ** * * k=0;k<i-1;k++){
* *** * * ** * ** ** * *** ** * ** * ** * * * * * * * * ** > people[k+1].score){
* **** ** * * ** * * ** * * ** * * * *** ***** ** * * * **** ** *** * ** ** ** *** StdList change=people[k];
* * * ******* * ***** ** * * * *** * * * ** * ** * ** **** **** * *** * * * *** * * * *** * **
***** * **** * **** * **** * **** * *** ***** ** ** **** * * *** *** ** * * **** *
* ** * * * ** * ** * *** * ** ******* * ** *** ** * *** * ** ***
* ** *** * * ** ** * * *** ** **** ***** **

    }
** * ***** ********** ** ** j=0;j<i;j++){
*** ** * * * *** ** ** *** * *** * * ** ** * *** *

    }
* * * ** *** *** *** * ** * * * who got a higher grade than the average grade of all students:\n");
* ** * ** ** *** ******* ****
* ****** *** * *** *** *** ** * * * ** *** ** ** ** ****** %s\nCode: %s\nGrade: ***** **** *** ** *** *** * * *
******* * * *** *** ** * ** *
** * ** ** * * * *** *** ** * * ***** **** * * *** j=0;j<i;j++){
*** *** * ****** * *** ** ** *** * * **** ** * * *** * ** * ** **** **** * ** * *
** * * * * ***** ****** ** * **** * ** * * * * * * ** * * ** * * **** ** ***** ***** * * ** * %s\nCode: %s\nGrade: ** * **** * * * *** **** * ***** *
** *** * * ** * ** * ** ** * *** * ** * ***** ***
** ** * * * * ** * ** *** ** ***** * *** *** * ****

    }

}

int main()

{
* * * ***** * *** * c=1,i=0;
*** * * * ** ** * * StdList people[100];
* * * ** * ** *** *** * ***
* * * ** * *** **** ** ** ** * ** **** ***** * ********* **** * ***** **
** * * * * *** * **** ** * *** * * * ** * * * ** ** ** *** *** ** * *****
** * * ** * * **** ** *** * * * ** * ** **** * * * * ** ******* *** **
* * **** * * ** ***** ***** * * * * ** *
* * * ** ** ** * *** ** ** * * *** * ** * * * * *** * * * *
***** *** * * ********* * * **** ** ** * *** ****

    }
** * * *** * ** *** * * ** ** **
**** * * **** *** ** * 0;

}
answered by (-384 points)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.178.106
©2016-2024

Related questions

0 like 0 dislike
32 answers
[Exercise] Coding (C) - asked Apr 6, 2017 in C
ID: 23557 - Available when: Unlimited - Due to: Unlimited
| 950 views
0 like 0 dislike
18 answers
[Exercise] Essay (Open question) - asked Apr 20, 2017 in C
ID: 24219 - Available when: Unlimited - Due to: Unlimited
| 865 views
12,783 questions
183,443 answers
172,219 comments
4,824 users