fork download
  1. #include <stdio.h>
  2.  
  3. void main()
  4. {
  5. int a[10];
  6. int c;
  7. int i,j;
  8.  
  9. printf("정렬 전 : ");
  10.  
  11. for (i = 0 ; i<10;i++)
  12. {
  13. printf("%c", num[i]);
  14.  
  15. }
  16.  
  17.  
  18. for(i=0;i<10;j++)
  19. {
  20. for(j=0;j<9;k++)
  21. {
  22. if(num[j] > num[j+1])
  23. {
  24. c = a[j];
  25. a[j]=a[j+1];
  26. a[j+1] = c;
  27. }
  28. }
  29. }
  30.  
  31.  
  32. printf("정렬 후 : ");
  33.  
  34. for (i = 0 ; i<10;i++)
  35. {
  36. printf("%c", num[i]);
  37.  
  38. }
  39.  
  40.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:3:6: warning: return type of ‘main’ is not ‘int’ [-Wmain]
 void main()
      ^~~~
prog.c: In function ‘main’:
prog.c:13:27: error: ‘num’ undeclared (first use in this function)
              printf("%c", num[i]);
                           ^~~
prog.c:13:27: note: each undeclared identifier is reported only once for each function it appears in
prog.c:20:21: error: ‘k’ undeclared (first use in this function)
         for(j=0;j<9;k++)
                     ^
prog.c:38:1: error: expected declaration or statement at end of input
 }
 ^
stdout
Standard output is empty