what is the output of below
int n=10;
(n++)++;
printf("%d",n);
Answers were Sorted based on User's Feedback
Answer / kirankumaryakkala
ans. error:Lvalue required
why? Lvalue means leftside assignment value,
here, first it goes to increment on N, again it is going to
increment, before going to increment second time, you should
allocate one varibale that holds the first time increment
value, other wise from where to it increment...
Is This Answer Correct ? | 11 Yes | 1 No |
Answer / 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 |
Is exit(status) truly equivalent to returning the same status from main?
1.what are local and global variables? 2.what is the scope of static variables? 3.what is the difference between static and global variables? 4.what are volatile variables? 5.what is the use of 'auto' keyword? 6.how do we make a global variable accessible across files? Explain the extern keyword? 7.what is a function prototype? 8.what does keyword 'extern' mean in a function declaration?
Is the following code legal? struct a { int x; struct a b; }
What is pre-emptive data structure and explain it with example?
give one ip, find out which contry
1.write a program to merge the arrays 2.write efficient code for extracting unique elements from a sorted list of array?
what is memory leak?
What is diffrance between declaration and defination of a variable or function
What is the use of structure padding in c?
Is a house a mass structure?
Given an array of characters, how would you reverse it? How would you reverse it without using indexing in the array?
What was noalias and what ever happened to it?