Question
void main()
{
int a=10;
printf("%d %d %d", a, a++, ++a);
}
What will be output if you compile following c code ?
void main()
{
int a=10;
printf("%d %d %d", a, a++, ++a);
}
Answer: Option B
Was this answer helpful ?
In c printf function follows cdecl parameter passing scheme. In this scheme parameter is passed from right to left direction.
So 1st step ++a will pass and value a = 10 will get printed
Was this answer helpful ?
Submit Solution