

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


#include<stdio.h> #include<stdlib.h> #include<conio.h> struct result { char name[10]; int id; int marks[5]; float p; }; main() { struct result s1,p1; int i,total=0,max,n; p1=&s1; int pf(struct result); int large(struct result*); printf("Enter the name:"); scanf("%s",p1->name); printf("\nEnter the Id_no:"); scanf("%d",&p1->id); printf("\nEnter marks of 5 subjects:");
for(i=0;i<5;i++) { printf("\nMarks of sub %d:",i+1); scanf("%d",&p1->marks[i]); total=total+p1->marks[i]; } p1->p=(total)/5; printf("\nPercantage=%f",p1->p); n=pf(p1); if(n==1) { printf("\nStudent is pass."); } else { printf("\nStudent is fail."); } max=large(p1); printf("\nHighest marks is=%d",max); }
int pf(struct result *p1) { if((p1->marks[0]>35) && (p1->marks[1]>35) && (p1->marks[2]>35) && (p1>marks[3]>35) && (p1->marks[4]>35)) { return 1; }