The Daily CLAD

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

CLAD2017 - Answer the requirement: What are the odds of that

Active Participant

You are tasked to write a VI that accepts an array of positive numeric values (Data Array In) and outputs an array that contains all of the odd numbers found in the input array (Odd Data Samples Out).  Which of the following VIs satisfies those requirements?

 

NOTE:  For all case structures the only case not shown is the Default and in all instances that is wired Array Input Tunnel to Array Output Tunnel as shown:  Find the Odds #4 default.png 

 

Have a go at writing a VI yourself or expand the Spoiler tag to see the possible answers.

 

Spoiler

a)

Find the Odds #2.png

 

b)

Find the Odds #4.png

 

c)

Find the Odds #1.png

 

d)

Find the Odds #3.png

 

 

Combined.png

Comments
Knight of NI

A


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Member

A

Member

When you use the And function, comparing some number with a 1, what is LabVIEW checking? Is it just comparing the Least Significant Bit of the number with the 1?

 

Knight of NI

The AND is a bitwise function.  1&1 = 1, all others = 0.  So when you AND a number with 1, you are just masking the least significant bit (LSb).  That LSb represents 2^0 = 1.  So if you AND an integer with 1 and the result is 1, you have an odd number.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Member

A

Member

A

Member

 

Hello everyone!

 

In accordance with exercise description, the option that gives us the output which matches with "And" operation and "Not Equal To 0?" function is letter A.  

Tarciso Junior
+55 (11) 996-282-103
Skype: Tarciso.junior2
Email: Tsjabrantes@gmail.com
http://br.linkedin.com/pub/tarciso-junior/23/a83/463
Member

Thx Crossrulz for that tip. Good to know. I always read your advices like a Bible Smiley Wink

Member

A

Member

A. 

Member

a

Member

A is the ans.....

NI Employee

a)

Active Participant

Answer:A. Nice one all.  What do people think about the answer the requirement type questions?  They are good fun to write!

Combined.png