Q. | What will be output if you will compile and execute the following c code? void main(){
int a=10;
printf("%d %d %d",a,a++,++a);
}
|
|||||||
|
Answer: | Option D | |
Explaination: | In c printf function follows cdecl parameter passing scheme. In this scheme parameter is passed from right to left direction.So first ++a will pass and value of variable will be a=10 then a++ will pass now value variable will be a=10 and at the end a will pass and value of a will be a=12. |
Discussion
Your Comments Goes here... |
Name | Discussion |
---|