...
Question 14055 – NIC-NIELIT Scientist-B 2020
November 14, 2023
Logical-Reasoning
November 14, 2023
Question 14055 – NIC-NIELIT Scientist-B 2020
November 14, 2023
Logical-Reasoning
November 14, 2023

Question 4276 – UGC NET CS 2005 june-paper-2

Find the output of the following “C” code :
main ( )
{
int x=20, y=35;
x= y++ + x++;
y= ++y + ++x;
printf (“%d, %d\n”, x,y);
}

Correct Answer: E

Question 12 Explanation: 
Step-1: Here, we are using post increment for both x and y. In post increment the value assign first and update after assigning.
x= 35 + 20
y= 37 + 56 (In this statement, ‘y’ will become 36 before performing pre increment)
Step-2: Final x=56 and y=93
Note: They given wrong options. We are added correct option.
Excluded for evaluation.
A
55, 93
B
53, 97
C
56, 95
D
57, 94
E
56, 93
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!