What will be printed out as a result of the following program's execution:
#include <iostream>
#include <stdio.h>

int main() {
    std::cout << printf("boom!");

    return 0;
}
Explanation
"boom!5" should be printed out because printf() returns an int equal to the number of characters printed to stdout (for more details visit C++ reference printf). std::cout is synchronized with the stdout, so "boom!" will be transfered to stdout first and "5" - after that (for more details visit C++ reference ios_base::sync_with_stdio).

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
C++ quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes