Originally Posted by
jackson6612
Code:
#include <iostream>
using namespace std;
int main()
{
float a = 2.6e5F;
float b = 1 + a;
cout << "enter a = ";
cin >> a;
cout << b << endl;
system("pause");
}
This suggests to me that you're thinking about '=' in the mathematical way. In C++ and most languages, '=' means something else, it means assignment. For example, it is perfectly legitimate to write:
Code:
b = 1; // Now b has a value of 1
b = 1 + b; // 1 + b is 1 + 1 which is 2, so now b has a value of 2