fork download
  1. #include <stdio.h>
  2. #define N 10
  3.  
  4. int arr[];
  5. int main(){
  6.  
  7. for(int i=0; i<10;i++){
  8. scanf("%d", arr[i]);
  9. }
  10.  
  11.  
  12. for (i = 0; i < N - 1; i++)
  13. {
  14. index = i;
  15. for (int j = i + 1; j < N; j++)
  16. {
  17. if (arr[index] > arr[j])
  18. {
  19. index = j;
  20. }
  21. }
  22. temp = arr[index];
  23. arr[index] = arr[i];
  24. arr[i] = temp;
  25. }
  26.  
  27.  
  28. if( array[2]<60){
  29. printf("F");}
  30. else if{ 59<array[2] && array[2]<65}
  31. printf("D+");}
  32. else if{ 64<array[2] && array[2]<70}
  33. printf("D");}
  34. else if{ 69<array[2] && array[2]<75}
  35. printf("C+");}
  36. else if{ 5<array[2] && array[2]<85}
  37. printf("C");}
  38. else if{ 79<array[2] && array[2]<86}
  39. printf("B");}
  40. else if{ 84<array[2] && array[2]<90}
  41. printf("B+");}
  42. else if{ 89<array[2] && array[2]<95}
  43. printf("A");}
  44. ele printf("A+");
  45.  
  46. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function 'main':
prog.c:8:7: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
 scanf("%d", arr[i]);
       ^
prog.c:12:6: error: 'i' undeclared (first use in this function)
 for (i = 0; i < N - 1; i++)
      ^
prog.c:12:6: note: each undeclared identifier is reported only once for each function it appears in
prog.c:14:1: error: 'index' undeclared (first use in this function)
 index = i;
 ^
prog.c:22:1: error: 'temp' undeclared (first use in this function)
 temp = arr[index];
 ^
prog.c:28:5: error: 'array' undeclared (first use in this function)
 if( array[2]<60){
     ^
prog.c:30:8: error: expected '(' before '{' token
 else if{ 59<array[2] && array[2]<65}
        ^
prog.c:30:10: warning: statement with no effect [-Wunused-value]
 else if{ 59<array[2] && array[2]<65}
          ^
prog.c: At top level:
prog.c:32:1: error: expected identifier or '(' before 'else'
 else if{ 64<array[2] && array[2]<70}
 ^
prog.c:33:12: error: expected declaration specifiers or '...' before string constant
     printf("D");}
            ^
prog.c:33:17: error: expected identifier or '(' before '}' token
     printf("D");}
                 ^
prog.c:34:1: error: expected identifier or '(' before 'else'
 else if{ 69<array[2] && array[2]<75}
 ^
prog.c:35:12: error: expected declaration specifiers or '...' before string constant
     printf("C+");}
            ^
prog.c:35:18: error: expected identifier or '(' before '}' token
     printf("C+");}
                  ^
prog.c:36:1: error: expected identifier or '(' before 'else'
 else if{ 5<array[2] && array[2]<85}
 ^
prog.c:37:12: error: expected declaration specifiers or '...' before string constant
     printf("C");}
            ^
prog.c:37:17: error: expected identifier or '(' before '}' token
     printf("C");}
                 ^
prog.c:38:1: error: expected identifier or '(' before 'else'
 else if{ 79<array[2] && array[2]<86}
 ^
prog.c:39:12: error: expected declaration specifiers or '...' before string constant
     printf("B");}
            ^
prog.c:39:17: error: expected identifier or '(' before '}' token
     printf("B");}
                 ^
prog.c:40:1: error: expected identifier or '(' before 'else'
 else if{ 84<array[2] && array[2]<90}
 ^
prog.c:41:12: error: expected declaration specifiers or '...' before string constant
     printf("B+");}
            ^
prog.c:41:18: error: expected identifier or '(' before '}' token
     printf("B+");}
                  ^
prog.c:42:1: error: expected identifier or '(' before 'else'
 else if{ 89<array[2] && array[2]<95}
 ^
prog.c:43:12: error: expected declaration specifiers or '...' before string constant
     printf("A");}
            ^
prog.c:43:17: error: expected identifier or '(' before '}' token
     printf("A");}
                 ^
prog.c:44:1: error: unknown type name 'ele'
 ele printf("A+");
 ^
prog.c:44:12: error: expected declaration specifiers or '...' before string constant
 ele printf("A+");
            ^
prog.c:46:1: error: expected identifier or '(' before '}' token
 }
 ^
prog.c:4:5: warning: array 'arr' assumed to have one element
 int arr[];
     ^
stdout
Standard output is empty