-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy path16.c
More file actions
36 lines (29 loc) · 691 Bytes
/
Copy path16.c
File metadata and controls
36 lines (29 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <stdio.h>
#define MAX_SIZE 100
int main()
{
int size;
int array1[MAX_SIZE];
int array2[MAX_SIZE];
int sum[MAX_SIZE];
printf("Enter the size of the arrays: ");
scanf("%d", &size);
printf("Enter elements of Array 1:\n");
for (int i = 0; i < size; i++)
{
scanf("%d", &array1[i]);
}
printf("Enter elements of Array 2:\n");
for (int i = 0; i < size; i++)
{
scanf("%d", &array2[i]);
}
printf("Sum of the arrays:\n");
for (int i = 0; i < size; i++)
{
sum[i] = array1[i] + array2[i];
printf("%d ", sum[i]);
}
printf("\n");
return 0;
}