The Daily CLAD

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

Re: For loop iteration control #3

SercoSteveB
Active Participant

What is the value in Numeric Value Out after the following has executed?

 

Daily CLAD #6.png

 

a) 0

b) 5

c) 9

d) 12

Comments
SercoSteveB
Active Participant

Answer: D

For loop iteration count can be controlled by; the value wired to the Count (N) terminal, the size of an input array (with auto-indexing enabled) or optionally by a Conditional terminal.  If multiple specifications of iteration count are made (as in the question) the loop will always opt for the fewest number of iterations.  In the question the loop will iterate 4 times defined by the size of the smaller of the two auto-indexed arrays. 

At run time:

On the fourth (and final) iteration of the loop the values auto-indexed from the arrays are 4 & 8; these are added together and passed to the output tunnel.  Having completed four iterations the For loop completes and the value in the output tunnel is passed to Numeric Value Out.

mini09
Active Participant

this is nice example Mr.Steve .... Bravo!!!!!

swetha_sadula
Member

ANswer:D

nmpundlik
Member

Ans: d) 12

vksingh
Member

12

thats it for now....
SOM19
Member

D

ashwinilele
Member

D 12

eleshrudra
Member

d

R.Elesh
Andreas.Bernau
Member

D

Rashme_SR
Member

D

sac0071
Member

D

M.P.Bharghavi
Member

Ans: D

J.Nivetha
Member

D

N.UdhayaKamali
Member

12

Lily2016
Member

D

Ronie7
Member

D

Blake.N
Member

D, With no shift registers values can not be carried through loops therefore the last iteration shall be 4+8

skian
Member

D