Cisco Systems Interview Question: More qns about pointers! And ... | Glassdoor

Interview Question

Software Engineer Interview

More qns about pointers! And assignments in if and while

  looks. if ( a = b) {} and while(a=b) {}

Interview Answer

2 Answers


while a = b gives an infinite loop and if a = b will always be true and will assign a the value of b

A on Apr 30, 2013

Like you said, the answer depends on b. If b = 0, both expressions would then be false.

B on Jun 5, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.