Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

(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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions