SHARE
TWEET

Untitled

a guest Jun 19th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. typedef struct Student{
  2.  
  3. char name [20] ;
  4.  
  5. int grade ;
  6.  
  7. int number ;
  8.  
  9.  
  10.  }Student;
  11.  
  12.  
  13.  typedef struct Class{
  14.  
  15. char className[20] ;
  16.  
  17. Student Students[30] ;
  18.  
  19.  
  20.  }Class;
  21.      
  22. double calculateAverageGrade(I want to pass the Students[30] array here ) {
  23.  
  24. int i ;
  25.  
  26. int sum = 0 ;
  27. for(i=0;i<3;i++) {
  28.  
  29.  
  30.  }
  31.  
  32. return sum/3 ;
  33.  
  34.   }
  35.      
  36. int main() {
  37.  
  38.  
  39. Student s1 ={"John",75,758} ;
  40.  
  41. Student s2 = {"Jack",85,123} ;
  42.  
  43. Student s3 = {"Lisandra",50,321} ;
  44.  
  45. Class c1 ={''} ;
  46.  
  47. strcpy(c1.className,"Physics") ;
  48.  
  49. c1.Students[0] = s1 ;
  50.  
  51. c1.Students[1] = s2 ;
  52.  
  53. c1.Students[2] = s3 ;
  54.  
  55.  
  56. calculateAverageGrade(needs to take Students[30] array);
  57.  
  58.  
  59.  
  60.  
  61.  
  62. return 0 ;
  63. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top