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;
"boom!5" should be printed out because printf() returns an int equal to the number of characters printed to stdout (for more details visit http://www.cplusplus.com/reference/clibrary/cstdio/printf/). std::cout is synchronized with the stdout, so "boom!" will be transfered to stdout first and "5" - after that (for more details visit http://www.cplusplus.com/reference/iostream/ios_base/sync_with_stdio/).

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback