What will i and j equal after the code below is executed? Explain your answer.



What will i and j equal after the code below is executed? Explain your answer...

Answer / hrpynux@gmail.com

After the above code executes, i will equal 6, but j will equal 5. Understanding the reason for this is fundamental to understanding how the unary increment ( ++ ) and decrement ( -- ) operators work in C++.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Search for: what is pair in c++?

0 Answers  


Design a program to input a date from user in the form day/month/year (e.g. 2/6/2000) and report whether it’s a valid date or not. The program should take account of leap years. You will need to know that a leap year is a year that is exactly divisible by 4, except that century years are only leap years if they are divisible by 400.

1 Answers  


What happens when a function throws an exception that was not specified by an exception specification for this function?

1 Answers  


What does count ++ do in c++?

0 Answers  


What are dynamic type checking?

0 Answers  






Differentiate between a template class and class template?

1 Answers  


When a function is made inline. Write the situation where inline functions may not work.

2 Answers  


Does std endl flush?

0 Answers  


char *ch = "abcde"; char c[4]; how to copy 'ch' to 'c'?

4 Answers   Thomson Reuters,


How should a contructor handle a failure?

0 Answers  


Define a pdb file.

0 Answers  


Explain the difference between struct and class in terms of access modifier.

0 Answers  


Categories