UGC NET CS 2014 Dec-Paper-2
May 22, 2024Question 4807 – UGC NET CS 2014 Dec-Paper-2
May 22, 2024UGC NET CS 2014 Dec-Paper-2
|
Question 11
|
What will be the output of the following ‘C’ code ?
main( )
{
int x=128;
printf (“\n%d”, 1 + x++);
}
main( )
{
int x=128;
printf (“\n%d”, 1 + x++);
}
|
128
|
|
|
129
|
|
|
130
|
|
|
131
|
Question 11 Explanation:
In this program we are using post increment. Post increment will send the value before updating the value.
printf(“\n%d”, 1 + x++); /* x=128 */
Here, 1+128=129
printf(“\n%d”, 1 + x++); /* x=128 */
Here, 1+128=129
Correct Answer: B
Question 11 Explanation:
In this program we are using post increment. Post increment will send the value before updating the value.
printf(“\n%d”, 1 + x++); /* x=128 */
Here, 1+128=129
printf(“\n%d”, 1 + x++); /* x=128 */
Here, 1+128=129
