Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started