Question: In C language #include struct student { char name [16]; int grade; }; int main() { struct student t; struct student x={Jeremy Lin, 100}; struct

In C language

#include

struct student {

char name [16];

int grade; };

int main()

{

struct student t;

struct student x={"Jeremy Lin", 100};

struct student y={"Tim Teebow", 100};

if (x.grade > y.grade)

{t= x;printf ("Higher grade: %d ", t.grade) ;}

else if (x.grade< y.grade)

{t=y;printf ("Higher grade: %d ", t.grade) ;}

else { t=x; printf ("Two grades tie: %d ", t.grade) ;}

return 0;

}

Please modify the above program, so it will ask the username and grade and will output a result of whose grade is higher or the two grades are tied. One possible output is here:

Please enter a username: Lin Please enter the grade: 101 Lin has Higher grade: 101

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!