Home Subjects Placement Papers Cognizant Questions

Placement Papers
Cognizant Questions

TCS, Infosys, Wipro, Cognizant actual papers

1 Q 10 Topics Take Mock Test
Advertisement
Difficulty: All Easy Medium Hard 1–1 of 1
Topics in Placement Papers
Q.1 Hard Cognizant Questions Cognizant
What will be the output? int x = 5; System.out.println(++x + x++);
A 11
B 12
C 13
D 10
Correct Answer:  B. 12
EXPLANATION

++x increments x to 6 first, then x++ uses 6 and increments to 7. So 6 + 6 = 12

Test
IGET
IGET AI
Online · Exam prep assistant
Hi! 👋 I'm your iget AI assistant.

Ask me anything about exam prep, MCQ solutions, study tips, or strategies! 🎯
UPSC strategy SSC CGL syllabus Improve aptitude NEET Biology tips