Last Updated: 13 Feb, 2017

Multiples of 2 and 3

Easy
Asked in company
Pinnacle Works Infotech

Problem statement

Find and return the sum of all elements in an array which are either divisible by 2 or by 3.

Input Format :
Line 1: N + 1 integers, where 1st integer denotes the size of array N and next N are elements of the array, separated by spaces
Output Format:
A single integer denotes the sum of all those numbers which satisfy the specified condition.
Constraints :
1<= N <=10^5)