
Learn core concepts, essential formulas, and attempt practice questions designed on the latest TCS NQT testing patterns.
What is the output: printf("%d", printf("TCS"));
Correct Answer: A) TCS3
Step-by-step Solution: The inner printf runs first, outputting the string 'TCS'. It returns 3 (number of characters). The outer printf then prints this return value (3). Combined output: TCS3.
What is value of x: int x = 5; x = x++ + ++x;
Correct Answer: D) Undefined behavior
Step-by-step Solution: Modifying a variable multiple times within a single sequence point (x = x++ + ++x) leads to undefined behavior in standard C/C++.
Understand prefix vs postfix. Postfix increments value after returning it; prefix increments immediately.