Advertisement
Guest User

Untitled

a guest
Feb 21st, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. void main() {
  6.  
  7. int t = 0;
  8. int x[3][1000];
  9. time_t T;
  10.  
  11. srand(time(&T));
  12.  
  13. for (int i = 0; i < 1000; i++) {
  14. x[0][i] = rand() % 2000 - 1000;
  15. x[1][i] = rand() % 2000 - 1000;
  16. x[2][i] = x[0][i] + x[1][i];
  17. t += x[2][i];
  18. }
  19.  
  20. printf("Total of two arrays: %d\n", t);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement