Write Function Counts People Class Gpa Greater G Make Sure Using Pointers Struct Person Ch Q37218901

//Write a function which counts all the people in the class witha gpa greater than g. Make sure using only pointers.
struct person{
char netid[15];
float gpa;
char* major;
int age;
} class[50];

//Assume class[50] is fully initialized.
struct person *p = &class[0];

int countGPA(struct person *p, float g, int sizeofClass)


Answer


struct person { char netid[15]; float gpa; char *major; int age;} class[50];//Assume class[50] is fully initialized.struct person *p = &class[0];int countGPA(struct person *p, float g, int sizeofClass) { int i, count = 0; for (i = 0; i <

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.