LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can we initialize a loop with a value otherthan zero

why we initialize variable twice time in program outer and inner the loop

like 

int i,j=1;

for(i=10;i>0;i-=1)

{

printf("\n i =%d\t j = %dd", i,j);

j=j*2;

}

how its work????

0 Kudos
Message 11 of 12
(289 Views)

Hi Abeer,

 

why we initialize variable twice time in program outer and inner the loop

So you do something and then you ask us, why you do so? 😄

You should ask the one how wrote that text-based code…

 

how its work????

What is "its"?

Do you need comments on that text-based code?

Or do you have problems to create a LabVIEW VI for this algorithm?

(The FOR loop can be done as is shown above, for j you should use an additional shift register and "printf" is called FormatIntoString in LabVIEW…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 12
(280 Views)