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
Where does the name "C" come from, anyway?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
What is bubble sort in c?
How do you define a string?
In c language can we compile a program without main() function?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
How can a string be converted to a number?
What is double pointer in c?
general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only
a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.
Why cant I open a file by its explicit path?
Write a program to print factorial of given number using recursion?
What does a function declared as pascal do differently?
Differentiate between functions getch() and getche().
What is ctrl c called?