what is the output of below
int n=10;
(n++)++;
printf("%d",n);
Answer Posted / deepak kumar
error : lvalue required.
n++ return 10 and after that n will increase to 1.
so now n=11
but next operation (postfix operator) is performing on
constant value 10 which is returned by (n++) operation.
it actually try to assign 11 to constant value 10. it is not
possible .
firstly we have to store it in a variable and then increment
can take place..
| Is This Answer Correct ? | 9 Yes | 2 No |
Post New Answer View All Answers
If the size of int data type is two bytes, what is the range of signed int data type?
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
What are integer variable, floating-point variable and character variable?
How we can insert comments in a c program?
Combinations of fibanocci prime series
Tell us something about keyword 'auto'.
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
Is null a keyword in c?
What is cohesion and coupling in c?
Can we replace the struct function in tree syntax with a union?
Explain how can you tell whether a program was compiled using c versus c++?
What is static and volatile in c?
What is a nested formula?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
What is int main () in c?