Advertisement
rony-Rony_05

Untitled

Sep 22nd, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.95 KB | None | 0 0
  1. #include<stdio.h>
  2. struct student
  3. {
  4.     char name[20];
  5.     char ID[10];
  6.     int sem,course;
  7. };
  8. int main()
  9. {
  10.     struct student st[50];
  11.     int i,max,max1;
  12.     for(i=0; i<5; i++)
  13.     {
  14.         scanf("%s",st[i].name);
  15.         scanf("%s",st[i].ID);
  16.         scanf("%d %d",&st[i].sem,&st[i].course);
  17.     }
  18.     max=st[0].course;
  19.     for(i=0; i<5; i++)
  20.     {
  21.         if(max<st[i].course)
  22.         {
  23.             max=st[i].course;
  24.  
  25.         }
  26.     }
  27.     printf("Boro Vai\n");
  28.     for(i=0; i<5; i++)
  29.     {
  30.         if(max==st[i].course)
  31.         {
  32.             printf("%s\n",st[i].name);
  33.         }
  34.     }
  35.     printf("\n");
  36.         max1=st[0].course;
  37.     for(i=0; i<5; i++)
  38.     {
  39.         if(max1>st[i].course)
  40.         {
  41.             max1=st[i].course;
  42.  
  43.         }
  44.     }
  45.     printf("Choto Vai\n");
  46.     for(i=0; i<5; i++)
  47.     {
  48.         if(max1==st[i].course)
  49.         {
  50.             printf("%s\n",st[i].name);
  51.         }
  52.     }
  53.     return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement