From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

The Daily CLAD

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

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

SercoSteveB
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

 

 

Comments
crossrulz
Knight of NI

A


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
GladysToMeetYou
Member

A

GladysToMeetYou
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?

 

crossrulz
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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
A_rid
Member

A

nik35324
Member

A

Tsjabrantes
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
Didoo
Member

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

qubirt
Member

A

Matt-A.
Member

A. 

Ellie90
Member

a

SravanKumarAtla
Member

A is the ans.....

Sravankumar Atla
CLD || CTD
CataM
NI Employee (retired)

a)

SercoSteveB
Active Participant

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

istan0227
Member

A