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
What is the difference between c and python?
why do some people write if(0 == x) instead of if(x == 0)?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
How we can insert comments in a c program?
What is function pointer c?
please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com
How can I manipulate individual bits?
How can I write a function that takes a format string and a variable number of arguments?
What is the difference between text and binary i/o?
What are the different types of pointers used in c language?
What is 1f in c?
What is the use of function in c?
What is the difference between text files and binary files?
What is nested structure with example?
How can I generate floating-point random numbers?