Check out example codes for "Compound assignment in c++". It will help you in understanding the concepts better.

Code Example 1

#include<iostream>
using namespace std;

int main() {
   int a = 3, b = 2;

   a += b;
   cout << a << endl;

   a -= b;
   cout << a << endl;

   a *= b;
   cout << a << endl;

   a /= b;
   cout << a << endl;

   return 0;
}

Learn ReactJs, React Native from akashmittal.com