Write a program in C++ that receives two values ??from the user and stores them in two variables,…
Write a program in C++ that receives two values ??from the user and stores them in two variables, swaps the two values ??in the computer’s memory, and displays the result. The program must meet the following requirements:
– Declare two pointers that each refer to one of the variables mentioned above.
– Any interaction with the variables MUSTbedone by using the pointers using the indirection (*) operator and reference operator (&). It is NOTallowed to work directly with the variables, e.g. var1 = var2; is not permissible.
– Also display in all cases both the values ??and the addresses of all relevant variables before and after the exchange of the values??in memory.
Tip: The cin instruction works directly with the variable to read a value from the user and is therefore not permissible. scanf() reads values ??from the user and stores that value in a specific memory address, e.g. scanf (“%d”, pointer); will store an integer in the memory address to which pointerrefers. Remember to add the #include pre-processing directive at the top of your program to be able to use printf()/scanf().