I'm trying to do the following assignment in a c++ book.
After running this:
#include <iostream>
using namespace std;
int main()
{
double first_arg;
double second_arg;
cout << "Enter first argument: ";
cin >> first_arg;
cout << "Enter second argument: ";
cin >> second_arg;
cout << first_arg << " * " << second_arg << " = "
<< cout << first_arg * second_arg << "\n";
cout << first_arg << " + " << second_arg << " = "
<< cout << first_arg + second_arg << "\n";
cout << first_arg << " / " << second_arg << " = "
<< cout << first_arg / second_arg << "\n";
cout << first_arg << " - " << second_arg << " = "
<< cout << first_arg - second_arg << "\n";
I get some unexpected results. Like this result copied straight from the windows cli:
Enter first argument: 7
Enter second argument: 9
7 * 9 = 0x6fcc43c463
7 + 9 = 0x6fcc43c416
7 / 9 = 0x6fcc43c40
7 - 9 = 0x6fcc43c4-2
I'm using the latest version of codeblocks with the default compiler settings. Thanks.