Question: #include #include #include struct student { char name[30]; char address[50]; char phno[20]; float marks[5]; }; void program(); void main { program(); } void program() {

#include #include #include struct student { char name[30]; char address[50]; char phno[20]; float marks[5]; }; void program(); void main { program(); } void program() { int i; float total=0.0,per; struct student st; printf("Enter student details "); printf("Enter Name:"); gets(st.name); printf("Enter Address:"); gets(st.address); printf("Enter Phone number:"); gets(st.phno); printf("Enter student marks: "); for(i=0;i<5;i++) { scanf("%f",&st.marks[i]); total+=st.marks[i]; } per=(total/5) system("cls"); printf("Student name: %s ",st.name); printf("Address: %s ",st.address); printf("Phone Number: %s ",st.phno); printf("Total Marks: %s ",total); printf("Percentage: %s ",per); if(per>80) { printf("Grade:A+"); } else if (per>70 && per<60) { printf("Grade:A"); } else if (per>60 && per<65) { printf("Grade:B+"); } else if (per>60 && per<50) { printf("Grade:B"); } else if (per>50) { printf("Grade:C"); } else { printf("Grade:F"); } getche(); }

make a simplified and shorter version of this code

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!