Question 14055 – NIC-NIELIT Scientist-B 2020
November 14, 2023Logical-Reasoning
November 14, 2023Question 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.
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.
55, 93
53, 97
56, 95
57, 94
56, 93
Subscribe
Login
0 Comments