fork download
  1. #include <stdio.h>
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <time.h>
  6.  
  7. int main()
  8. {
  9.  
  10. int i, a[10], b[10], c[20];
  11.  
  12. srand(time(NULL));
  13.  
  14. for(i = 0; i < 10; i++)
  15. {
  16. a[i] = rand()%20;
  17. b[i] = rand()%20;
  18. }
  19.  
  20. for(i = 0; i < 10; i++ )
  21. c[i] = a[i];
  22. for(i = 0; i < 10; i++ )
  23. c[i+10] = b[i];
  24.  
  25. printf("\nA: ");
  26. for(i = 0; i < 10; i++ )
  27. printf("%d ", a[i]);
  28.  
  29. printf("\nB: ");
  30. for(i = 0; i < 10; i++ )
  31. printf("%d ", b[i]);
  32.  
  33. printf("\nC: ");
  34. for(i = 0; i < 20; i++ )
  35. printf("%d ", c[i]);
  36.  
  37. return 0;
  38. }
  39.  
Success #stdin #stdout 0s 4408KB
stdin
Standard input is empty
stdout
A: 18 7 8 13 11 5 9 2 5 14 
B: 10 11 11 9 19 9 15 7 10 15 
C: 18 7 8 13 11 5 9 2 5 14 10 11 11 9 19 9 15 7 10 15