fork download
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <time.h>
  4.  
  5. main(){
  6. srand (time(NULL));
  7. int j, v;
  8. char i, mlt [6], a5[2][6] = {" x2", " x3"};
  9. do{
  10. system ("cls");
  11. for (j=0; j<10; j++){
  12.  
  13. v = rand () % 95;
  14. char* b4[6] = {a5[v]};
  15. char mik[10] = (col2 " ");
  16.  
  17. strcpy (mlt, mik);
  18. strcat (mlt, *b4);
  19. printf (" %s\n", mlt);
  20. }
  21. printf (reset "Press 'n' to exit... ");
  22. scanf (" %s", &i);
  23. }
  24. while (i!='n' && i!='N');
  25. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:5:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 main(){
 ^~~~
prog.c: In function ‘main’:
prog.c:15:29: error: ‘col2’ undeclared (first use in this function)
             char mik[10] = (col2 " ");
                             ^~~~
prog.c:15:29: note: each undeclared identifier is reported only once for each function it appears in
prog.c:15:33: error: expected ‘)’ before string constant
             char mik[10] = (col2 " ");
                            ~    ^~~~
                                 )
prog.c:17:13: warning: implicit declaration of function ‘strcpy’ [-Wimplicit-function-declaration]
             strcpy (mlt, mik);
             ^~~~~~
prog.c:17:13: warning: incompatible implicit declaration of built-in function ‘strcpy’
prog.c:17:13: note: include ‘<string.h>’ or provide a declaration of ‘strcpy’
prog.c:4:1:
+#include <string.h>
 
prog.c:17:13:
             strcpy (mlt, mik);
             ^~~~~~
prog.c:18:13: warning: implicit declaration of function ‘strcat’ [-Wimplicit-function-declaration]
             strcat (mlt, *b4);
             ^~~~~~
prog.c:18:13: warning: incompatible implicit declaration of built-in function ‘strcat’
prog.c:18:13: note: include ‘<string.h>’ or provide a declaration of ‘strcat’
prog.c:21:13: error: ‘reset’ undeclared (first use in this function); did you mean ‘tzset’?
     printf (reset "Press 'n' to exit... ");
             ^~~~~
             tzset
prog.c:21:18: error: expected ‘)’ before string constant
     printf (reset "Press 'n' to exit... ");
                  ^~~~~~~~~~~~~~~~~~~~~~~~
                  )
prog.c:10:5: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
     system ("cls");
     ^~~~~~~~~~~~~~
prog.c:22:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     scanf (" %s", &i);
     ^~~~~~~~~~~~~~~~~
stdout
Standard output is empty