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 arr1[1000];
- int arr2[1000];
- int arr3[1000];
- int max = 1000;
- int min = -1000;
- time_t t;
- int sum = 0;
- int i;
- srand(time(&t));
- for(i=0;i<1000;i++){
- arr1[i] = rand() % 2000 - 1000;
- arr2[i] = rand() % 2000 - 1000;
- }
- for(i=0;i<1000;i++){
- arr3[i] = arr1[i] + arr2[i];
- }
- for(i=0;i<1000;i++){
- sum += arr3[i];
- }
- printf("The sum of the third array is %d \n", sum);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement