forked from pragati-dhingra/the-book-of-c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpg233_q007.c
36 lines (35 loc) · 852 Bytes
/
pg233_q007.c
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>
int main (int argc, char* argv[] ){
/* Write a program that:
* 1. Reads twenty int as input in two arrays, ten int per array, one int per line
* First 10 ints go to first array (in order) and next 20 ints go to second array (in order)
* 2. Defines a function add() to add the values in both arrays and store result in third array
* 0th index of third array is sum of 0th index value in array 1 and 2
* 3. Prints contents of third array on a single line with one space after each element and no trailing newline.
* For example: Input
* 1
* 2
* 3
* 4
* 5
* 6
* 7
* 8
* 9
* 10
* 11
* 12
* 13
* 14
* 15
* 16
* 17
* 18
* 19
* 20
* Output:
* "12 14 16 18 20 22 24 26 28 30 "
* without quotes.
*/
return 0;
}