Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- void main() {
- int t = 0;
- int x[3][1000];
- time_t T;
- srand(time(&T));
- for (int i = 0; i < 1000; i++) {
- x[0][i] = rand() % 2000 - 1000;
- x[1][i] = rand() % 2000 - 1000;
- x[2][i] = x[0][i] + x[1][i];
- t += x[2][i];
- }
- printf("Total of two arrays: %d\n", t);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement