Purpose: Understand the pointer in C and know how tomanipulatepointers. Understand how to create a C program; compile and execute it. Description: Write a C program by implementing the following...



Purpose:



  1. Understand the pointer in C and know how tomanipulatepointers.

  2. Understand how to create a C program; compile and execute it.



Description:


Write a C program by implementing the following instructions:



  1. declare three integervariablesa1, b1, c1

  2. declare three integer pointer variablespa1,pb1,pc1

  3. assign 18 to variablea, 10 to variableb

  4. assign the address ofvariableato variablepa

  5. assignpatopb

  6. assignpatopc

  7. print out the values pointed by
    pa,pb,pc(dereferencing it)

  8. assign the address of variablebtopa

  9. print out the values pointed by
    pa,pb,pc(dereferencing it)


  10. print out the values of
    pa,pb,pc





Note: the format specifier for an address (pointer), you can use%p



What should be submitted:



  1. Run the program and submit asnapshotof successful program execution. (ForWindowsOS, use SnippingToolto take a snapshot.)

  2. Explain the difference between printing outpaand*pa

  3. Add a new statement to print out the value of variablea1, the address of variablea1,the size of variablea1.


  4. A .cfile thatcontains thecomplete source code of theprogram.

Feb 02, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here