What will be the value of $x$ and $y$ after execution of the following statement(C language)
n = 5; x = n++; y = -x;
Option D:
Given n =$5$,
$x=n++;$ which is also written as
$x =n;$
$n=n+1;$
so, now the x contains the value 5.
$y = -x;$
which is nothing but $y =-5$;
so the values are x = 5 and y = -5;
64.3k questions
77.9k answers
244k comments
80.0k users