Can anyone explain the output of the following program:
#include <iostream>
using namespace std;
int main()
{
int test = 0;
cout << "First character " << '1' << endl;
cout << "Second character " << (test ? 3 : '1') << endl;
return 0;
}
Output:
First character 1
Second character 49
But both the printf
statements should print the same line.