printf() arguments program interview question

Processing printf() arguments

Question: What would be the output of the following code?

int main(void)
    int a = 10, b = 20, c = 30;

    printf("\n %d..%d..%d \n", a+b+c, (b = b*2), (c = c*2));

    return 0;
Answer: The output of the above code would be :
This is because the arguments to the function are processed from right to left but are printed from left to right. appreciates your contribution please mail us the questions you have to so that it will be useful to our job search community

No comments: