fork download
  1. #include <stdio.h>
  2. main() {
  3. int arr[20], i, j, k, size;
  4.  
  5. printf("\nEnter array size : ");
  6. scanf("%d", &size);
  7. k=size;
  8.  
  9. printf("\nAccept Numbers : ");
  10. for (i = 0; i < size; i++)
  11. scanf("%d", &arr[i]);
  12.  
  13. for (i = 0; i < size; i++) {
  14. for (j=i+1; j< size; J++){
  15. if (a[i] == a[j]){
  16. printf("%d ",a[i]);
  17. i++;
  18. continue;
  19. }
  20. else {
  21. printf("nothing");
  22. }
  23. }
  24. }
  25. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
8
1 55 55 32 32 15 15 55
compilation info
prog.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 main() {
 ^~~~
prog.c: In function ‘main’:
prog.c:14:26: error: ‘J’ undeclared (first use in this function)
     for (j=i+1; j< size; J++){
                          ^
prog.c:14:26: note: each undeclared identifier is reported only once for each function it appears in
prog.c:15:11: error: ‘a’ undeclared (first use in this function)
       if (a[i] == a[j]){
           ^
prog.c:3:23: warning: variable ‘k’ set but not used [-Wunused-but-set-variable]
    int arr[20], i, j, k, size;
                       ^
stdout
Standard output is empty