well i am trying to learn to program on c++ with pdf course and now i got to the arithmetic operations and it asked me to build this code:
#include <iostream>
using namespace std;
int main ()
{
int x = 0;
int y = 0;
cout << "input the value of X " ;
cin >> x;
cout << " input the value of y " ;
cin >> y;
int a = x;
int b = x;
int c = x;
int d = x;
int e = x;
a += y;
b -= y;
c *= y;
d /= y;
e %= y;
cout << " x += y = " << a << endl;
cout << " x -= y = " << b << endl;
cout << " x *= y = " << c << endl;
cout << " x /= y = " << d << endl;
cout << " x %= y = " << e << endl;
}
my question is this, i just cant understand the operation, i see that i declared the a b c d e x and y as an integer, i input the value of x and y so this 2 values make all thoose operations. after this i dont understand much, i see that the value of a b c d and e became the same as x i just dont understand how for exemple a is summing with y or any other operation. what i am reading from the operation is this
a (the value i inputed in x) + ??? gives the result of y
but i know that thats not it so i am here to ask someone to help me understand, read this operations.
even if whats writen is "a plus y" to where is the result going? whats the operation telling to put the result of that operation as "a"?
i hope i made made myself clear and someone here can help me, i know its a noob question but i am trying to learn by myself and i have no one to help me around here. so thanks for anyone who read this