explain this nested printf statement
c, printf
Solution
The order of the internal `printf`s is unspecified. Another implementation, the same implementation with different compiler settings, or the same implementation with the same code in a different place might produce `byehi!9`.
The 9 comes because `printf` returns the number of characters printed, so the two internal `printf`s return 3 and the `*` is the familiar multiplication operator, giving 9.
Problem
``` int a = 5; #include <stdio.h> int main() { printf("%d", printf("hi!") * printf("bye")); return 0; } ``` Output: ``` hi!bye9 ``` I would like to know how the order in which the output has occurred. Does this mean `printf` function returns a value? What is the reason behind inner `printf` statements being executed first?