Dr. A.P.J. Abdul Kalam Technical University (AKTU), Lucknow

Lab Exercise

22. Write a program that inputs two arrays and saves the sum of corresponding elements of these arrays in a third array and prints them.

Sample Input and Output

Stdin Inputs:

23 64 39 56 38 36 96 43 62 47

Sample Result:

***Input elements of first array***
Input 1 element: 23
Input 2 element: 64
Input 3 element: 39
Input 4 element: 56
Input 5 element: 38

***Input elements of second array***
Input 1 element: 36
Input 2 element: 96
Input 3 element: 43
Input 4 element: 62
Input 5 element: 47

***Array having the sum of corresponding elements***
59 160 82 118 85

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top
Scroll to Top