value = 0xabcd;
for (loop = 1; (value >> 1) & 1 | loop & 1; loop++) {
foo();
if (loop & 1)
value >>= 1;
}

how many times is foo() executed?

Answer Posted / sbay

Shouldn't it be || though?
for (loop = 1; (value >> 1) & 1 || loop & 1; loop++)

????

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 5 types of organizational structures?

761


Explain how can I right-justify a string?

800


Why does this code crash?

824


What is c system32 taskhostw exe?

773


Explain what are multidimensional arrays?

796


How can I read/write structures from/to data files?

735


Does * p ++ increment p or what it points to?

828


Where local variables are stored in c?

724


please send me the code for multiplying sparse matrix using c

1920


Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.

816


What is modeling?

809


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

907


Define and explain about ! Operator?

772


What is a newline escape sequence?

846


What is a spanning Tree?

1219