fork download
  1. #include<stdio.h>
  2. #include<conio.h>
  3. typedef struct{
  4. char firstName[30];
  5. char lastName[30];
  6. int SID;
  7. int scores[4];
  8. }STUDENTS;
  9.  
  10. void inputRec(STUDENTS list[],int i){
  11. printf("Enter first name : ");
  12. scanf("%s",&list[i].firstName);
  13. printf("Enter last name : ");
  14. scanf("%s",&list[i].lastName);
  15. printf("Enter SID : ");
  16. scanf("%d",&list[i].SID);
  17. printf("Enetr scores : ");
  18. scanf("%d %d %d %d",&list[i].scores[0],&list[i].scores[1],&list[i].scores[2],&list[i].scores[3]);
  19. }
  20.  
  21. int checkAv(STUDENTS list[],int i){
  22. if(list[i].scores[0]+list[i].scores[1]+list[i].scores[2]+list[i].scores[3]<(90*4))
  23. return 0;
  24. else
  25. return 1;
  26. }
  27. int main(){
  28. STUDENTS list[100];
  29. int num,i;
  30. printf("Enter number of students(<100):");
  31. scanf("%d",&num);
  32. for(i=0;i<num;i++){
  33. inputRec(list,i);
  34. }
  35. printf("Student list averaged score higher than 90.0\n");
  36. for(i=0;i<num;i++){
  37. if(checkAv(list,i))
  38. printf("%s %s %d\n",list[i].firstName,list[i].lastName,list[i].SID);
  39. }
  40. printf("Press any key to continue\n");
  41. getch();
  42. return 0;
  43. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:2:18: fatal error: conio.h: No such file or directory
compilation terminated.
stdout
Standard output is empty