C Program to Access Elements of an Array Using Pointer

In this tutorial you will learn about the C Program to Access Elements of an Array Using Pointer and its application with practical example.

C Program to Access Elements of an Array Using Pointer

In this tutorial, we will learn to create a C program that will Access Elements of an Array Using Pointer using C programming.

Table Of Contents

Prerequisites

Before starting with this tutorial we assume that you are best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • For loop in C Programming.
  • Using pointer in C programming.

Access Elements of an Array Using Pointer:-

As we all know array is a collection of similar data type elements. In an array, only one variable is declared which can store multiple values. First will take the elements of an array from the user.  Then will pass the elements address to the pointer and the will print the elements of array /Access Elements of an Array Using Pointer with the help of C Programming Language.

Pointer is a variable that can store the address of another variable.

Algorithm:-

Program:-

Access Elements of an Array Using Pointer.

 

Output:-

The above program we have to first initialize the required variable.

 

  • array = it will hold the elements in an array.
  • i = it will hold the integer value to control array.

Creating Pointer.

  • *ptr = it will hold the address of elements in a array.

Taking input from the user in an array elements in array.

Printing using array.

In this tutorial we have learn about the C Program to Access Elements of an Array Using Pointer and its application with practical example. I hope you will like this tutorial.