Message Boards Message Boards

0
|
5084 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

quantity: odd number x even number

Posted 9 years ago

Hello, I ask how I should do this program:

I have values entered: odd numbers and even numbers

data = {1, 2, 5, 7, 8, 4, 12, 14, 15, 16, 18, 12, 17, 12, 15}

I need a list of numbers: Odd numbers: 6 Even numbers: 9

Thank you for the advice :)

POSTED BY: martin martin
2 Replies

Thank you :)

POSTED BY: martin martin
data = {1, 2, 5, 7, 8, 4, 12, 14, 15, 16, 18, 12, 17, 12, 15};

Length[Select[data, EvenQ]]

 9
POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract