Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ Write a C program to work on pointers. In main () you will first sum and set the initial Declare five integer variables named
C++
Write a C program to work on pointers. In main () you will first sum and set the initial Declare five integer variables named as a, b, values for a, b, c, as 10, 20, 30, respectively . c, temp, . Declare three integer pointers named as pa, pb, pc. These pointers shouled initially hold the addresses of variables a, b, c, respectively Declare three integer pointers to pointers as ppa, ppb, ppe. These pointers to pointers should initially hold the addresses of pointers pa, pb, pc, respectively . . If needed for the below tasks, you can declare other variables as well as pointers later.. . Now implement the following tasks in the main ) o Write the necessary statements to print the values of a, b, c by just using o Write the necessary statements to find the sum of the values in a, b, c by o Write the necessary statements to exchange/print the values in a and b, by o Write the necessary statements to exchange the values/addresses in pa and pb a, pb, ppc (direct, indirect, indirect indirect access) just using a, pb, ppc, sum. Then print sum. just using pa, ppb and maybe temp. Then print a and b. by just using pa, ppb and maybe a temp pointer that you can declare. Then print the values of a and b by directly using a and b as wells as indirectly by using *pa and *pb. Explain what happens here, why the values of a and b did not change when we access them directly while it seems the changed when we access them indirectly. Type your explanation as a c comment in your program after the printf statements. .Now copy/paste the following functions before your main O void increaseA (int val) t val++i void increaseB (int 'pval) f pval++: void increasec(int "pval) f pval++: void increaseD(int "pval) f(pval)++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