Assigning Values Code Problem

I don't know why I'm getting errors for this code when I copied it from my textbook. Can you explain what's wrong with this code when you try to run it? What corrections needs to be made? This code is suppose to cover the topic of assigning values. Also, I'm using Bloodshed Dev C++ as my IDE. any help or suggestions would be great.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#inlcude <iostream>
using namespace std;

int main() {
	int a, b;
	
	cout << "Assign values: ";
	cout << "a = " << (a=8) << " ";
	cout << "b = " << (b=4);
	
	cout << endl << "Add & assign: ";
	cout << "a += b (8+=4) a = " << (a+=b); 
	
	cout << endl << "Substract & assign: ";
	cout << "a -= b (12 -= 4) a = " << (a-=b);
	
	cout << endl << "Multiply & assign: ";
	cout << "a *= b (8 *= 4) a = " << (a*=b);
	
	cout << endl << "Divide & assign: ";
	cout << "a /= b (32 /= 4) a = " << (a/=b);
	
	cout << endl << "Modulus & assign: ";
	cout << "a %= b (8 %= 4) a = " << (a%=b);
	
	return 0;
	
}

Topic archived. No new replies allowed.