Question: (10 marks) Q4/B/ Write a C++ program to add two integer numbers if these numbers are negative and subtract them if these numbers are negative

(10 marks) Q4/B/ Write a C++ program to add two integer numbers if these numbers are negative and subtract them if these numbers are negative using pointers. Algorithm: 1. Initialize two integer variables. 2. Initialize two integer pointers. 3. Reference the pointers to variables using '&' operator. 4. Now, using * operator, access the address pointed by pointers. 5. Add the values and store them. 6. Print the sum. (10 marks) Q5/Write a C++ program to find the summation and multiplication of 10 integer numbers (1 to 10) and then write the result of the summation and multiplication to a file called (afile.dat) (20 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
