Skip to content

Latest commit

 

History

History
 
 

Chapter 06 — Pointers

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Chapter 6 - Practice Set

  1. Write a program to print the address of a variable. Use this address to get the value of this variable.
  2. Write a program having a variable i. Print the address of i. Pass this variable to a function and print its address. Are these addresses same? Why?
  3. Write a program to change the value of a variable to ten times its current value. Write a function and pass the value by reference.
  4. Write a program using a function that calculates the sum and average of two numbers. Use pointers and print the values of sum and average in main().
  5. Write a program to print the value of a variable i by using the "pointer to pointer" type of variable.
  6. Try problem 3 using call by value and verify that it doesn’t change the value of the said variable.