Math, asked by Nagasasi7406, 1 year ago

Add minimum number to an array so that the sum becomes even

Answers

Answered by jahanvi78
0
Solution :-

Given an array, write a program to add the minimum number(should be greater than 0) to the array so that the sum of array becomes even.

Examples:

Input : 1 2 3 4 5 6 7 8 Output : 2 Explanation : Sum of array is 36, so we add minimum number 2 to make the sum even. Input : 1 2 3 4 5 6 7 8 9 Output : 1


I hope it helps u dear ☺️.....
Similar questions