Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- struct student
- {
- char name[20];
- char ID[10];
- int sem,course;
- };
- int main()
- {
- struct student st[50];
- int i,max,max1;
- for(i=0; i<5; i++)
- {
- scanf("%s",st[i].name);
- scanf("%s",st[i].ID);
- scanf("%d %d",&st[i].sem,&st[i].course);
- }
- max=st[0].course;
- for(i=0; i<5; i++)
- {
- if(max<st[i].course)
- {
- max=st[i].course;
- }
- }
- printf("Boro Vai\n");
- for(i=0; i<5; i++)
- {
- if(max==st[i].course)
- {
- printf("%s\n",st[i].name);
- }
- }
- printf("\n");
- max1=st[0].course;
- for(i=0; i<5; i++)
- {
- if(max1>st[i].course)
- {
- max1=st[i].course;
- }
- }
- printf("Choto Vai\n");
- for(i=0; i<5; i++)
- {
- if(max1==st[i].course)
- {
- printf("%s\n",st[i].name);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement