cout << 2 << 4 << endl;
#include <iostream> using namespace std; int main() { int a, b; char o; string l = "Answer is: "; cout << "Enter First Number: "; cin >> a; cout << "Enter Second Number: "; cin >> b; cout << "\nEnter Operation: "; cin >> o; if (o == '+') cout << l << a + b << endl; else if (o == '-') cout << l << a - b << endl; else if (o == '*') cout << l << a * b << endl; else if (o == '/') cout << l << a / b << endl; else if (o == '%') cout << l << a % b << endl; else if (o == '<') cout << l << 2 << 4 << endl; return 0; }
endl
Quote:C++ cout << 2 << 4 << endl; It gives me 24 not 32. Why is that
cout
cin
cout << (2 << 4) << endl;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)