fork(1) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int n, j, i, p;
  5. int A[];
  6.  
  7. int main()
  8. {
  9. printf("Введите количество элементов в массиве ");
  10. scanf("%d", &n);
  11. printf("Введите элементы массива /n");
  12. for (i=1, i==n,i++)
  13. scanf("%d",&A[n]);
  14. for (j=1,j==n-1,j++)
  15. {
  16. if (A[j]>A[j+1])
  17. {
  18. p=A[j];
  19. A[j]=A[j+1];
  20. A[j+1]=p;
  21. }
  22. }
  23. for (i=1,i==n,i++)
  24. {
  25. printf("Отсортированный массив %d",A[i]);
  26. }
  27. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:12:10: warning: right-hand operand of comma expression has no effect [-Wunused-value]
  for (i=1, i==n,i++)
          ^
prog.c:12:20: error: expected ‘;’ before ‘)’ token
  for (i=1, i==n,i++)
                    ^
prog.c:12:20: error: expected expression before ‘)’ token
prog.c:14:10: warning: right-hand operand of comma expression has no effect [-Wunused-value]
  for (j=1,j==n-1,j++)
          ^
prog.c:14:21: error: expected ‘;’ before ‘)’ token
  for (j=1,j==n-1,j++)
                     ^
prog.c:14:21: error: expected expression before ‘)’ token
prog.c:23:10: warning: right-hand operand of comma expression has no effect [-Wunused-value]
  for (i=1,i==n,i++)
          ^
prog.c:23:19: error: expected ‘;’ before ‘)’ token
  for (i=1,i==n,i++)
                   ^
prog.c:23:19: error: expected expression before ‘)’ token
prog.c: At top level:
prog.c:5:5: warning: array ‘A’ assumed to have one element
 int A[];
     ^
stdout
Standard output is empty