C Exercises: Compute the sum of the two given arrays of integers of length 3 and find the array which has the largest sum
45. Compare Sum of Two Arrays
Write a C program to compute the sum of the two given arrays of integers, length 3 and find the array that has the largest sum.
C Code:
Sample Output:
Elements in original array are: 10, 20, -30 Elements in original array are: 10, 20, 30 The array which has the largest sum.: 10, 20, 30
Pictorial Presentation:
Flowchart:

For more Practice: Solve these Related Problems:
- Write a C program to compare the product of two arrays of length 3 and print the array with the larger product.
- Write a C program to calculate and compare the average of two 3-element arrays.
- Write a C program to sum elements of two arrays and return the array with the smallest sum.
- Write a C program to check two arrays of length 3 and return true if the sum of the first array is a multiple of the sum of the second.
C Programming Code Editor:
Previous: Write a C program to check a given array of integers of length 3 and create a new array.If there is a 5 in the given array immediately followed by a 7 then set 7 to 1.
Next: Write a C program to create an array taking two middle elements from a given array of integers of length even.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.