lucky7
(Vrishchiklucky)
September 26, 2023, 7:21am
1
Hi all,
I have an array of integer and I need to find the even number from that and need to ignore the odd number.
After finding the even number I need to add all the even number in the array.
For example: Input {0,1,2,3,4,5,6,7,8}
Even number:{0,2,4,6,8}
Addition of the even numbers: 20(0+2+4+6+8)
Some body please guide on this.
@ppr
@Yoichi
1 Like
Yoichi
(Yoichi)
September 26, 2023, 7:24am
2
HI,
How about the following?
arrInt.Where(Function(i) i mod 2 =0).Sum()
Regards,
Yoichi
(Yoichi)
September 26, 2023, 8:01am
4
HI,
arrInt is Array of Int32 (Int32[]
) type
Regards,
system
(system)
Closed
September 29, 2023, 8:02am
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.