admin@onlinelearningcenter.in (+91) 7 999 01 02 03

Sum of All even and odd number in an Array

Suraj Ghimire
13 Posts

Given an array of size N, Find out sum of all even number and sum of all odd number present in an array.

 

Example:

arr={1,2,3,4,5,6,7}

 

Output

Sum Of Even=12   ie (2+4+6)

Sum Of Odd =16   ie(1+3+5+7)

 

Published By : Suraj Ghimire
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Comments

Jquery Comments Plugin