Interview Question
Country: India
{
i have a doubt...
Unary operator have higher precedence over logical operator.So all unary operator should process first and should produce following output 0311
Please explain where i m wrong
}
{
i have a doubt...
Unary operator have higher precedence over logical operator.So all unary operator should process first and should produce following output 0311
Please explain where i m wrong
}
is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
m = ++i&& ++j || ++k;
- Gupta July 21, 2012in this case first value of 'i' is incremented , so it become 0 . in AND binary operation if one value is zero then there is no need to check other value , so we dont increment value of 'j' or say we do not bother about 'j' .so value of 'j' is still 2.
in this expression OR is also there so we have to value of k, so we increment value of 'k', that will now 1.
after all expression become true so value of 'm' is 1.
so final out put is 0 2 1 1