printf and cout Together
printf and cout can both be used in a program, but not for different parts of the same line of output
// These two lines are OK
cout << “This is cout-type output on a line\n”;
printf(“This is printf output on its own line\n”);
// This is an error because we’re trying to construct a single
// line using both cout and printf. It will compile correctly
// but the output won’t come out correctly.
cout << “How much wood would a wood-chuck chuck”;
printf(“ if a wood chuck could chuck wood?\n”);