fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int answer[4];
  7. int y=0;
  8. for(int x=0;x<=3;x++){
  9. while(y<=3){
  10. answer[x]=rand()%10
  11. y++;
  12. if(x~=y && answer[x]==answer[y]){
  13. answer[x]=rand()%10
  14. y=0;
  15. }
  16. }
  17. y=0;
  18. }
  19.  
  20. return 0;
  21. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:10:32: error: expected ‘;’ before ‘y’
             answer[x]=rand()%10
                                ^
                                ;
             y++;
             ~                   
prog.c:12:17: error: expected ‘)’ before ‘~’ token
             if(x~=y && answer[x]==answer[y]){
               ~ ^
                 )
prog.c:13:36: error: expected ‘;’ before ‘y’
                 answer[x]=rand()%10
                                    ^
                                    ;
                 y=0;
                 ~                   
prog.c:6:9: warning: variable ‘answer’ set but not used [-Wunused-but-set-variable]
     int answer[4];
         ^~~~~~
stdout
Standard output is empty