 Hello friends, I'm Sanjay Gupta. In this video, I'm going to demonstrate you how to print values of array using pointer. Before starting, you can note my information, you can follow or subscribe my YouTube channel through the URL youtube.com slash tanjaygupta underscore tech school. You can download my programming app TechMS, which is available on Google Play. Now I'm going to implement a code in C programming so that you can understand how you can print values of array using pointer. So I'm including a header file that is stdio.h. Now I am defining main function. Inside main function, I'm declaring an array whose size is 10, then pointer p and then variable i. Now to receive element from user, I am using printf statement which will display the message and the 10 elements on console. To read those elements, I am applying a loop which will repeat 10 times and through scanf, all the elements will be received and stored inside different indexes of array. So this is the reading operation of array. Now I am assigning address of array into pointer. So this statement will assign base address of array into pointer. So here you have to understand that name of array provides base address of array. So if I am writing p equals to a, it means base address of array is automatically available inside p. Now I can process whole array or you can say I can access all the elements of array through this p pointer. So to print elements of array, I am using again a for loop. Now inside this for loop, I will just use this pointer p to printing to print the element of array. So you can see I have not used name of array that is a, I have used just asterisk p. So asterisk operator will de-reference the address which is available inside p. So first time p is pointing to the base location. Now if you want to move to the second or third location, then for that purpose you have to use p++. So while incrementing the pointer by one, it automatically jumps to the next location that is available inside array. So with this loop, all the location of array will be displayed on console and at last I am using return 0. So this way I have implemented this program which will display all the elements available in array on console with the help of pointer. Now I am going to execute this code. It is asking for 10 numbers. So I am entering 10 different numbers. You can see all 10 numbers are displayed again on console with the help of this pointer. If you want to display some message with this loop like array contains. So this message will be displayed on console along with the elements. Again I am executing this code and I am entering 10 numbers. You can see the output array contains and all 10 numbers which I have entered are displayed again with the help of this second loop. So in second loop, I have used only pointer instead of array. So with this example, I have demonstrated you how you can process different different locations of array with the help of pointer. So to receive elements, you have to use this asterisk p notation and to move to the locations of array, you have to increase that pointer by one. So this way you can process all the locations of array using pointer. I hope you have understood how we can print all the elements of array using pointer. If you want to watch more programming related videos, you can follow or subscribe my YouTube channel through the URL youtube.com slash sanjaygupta underscore tech school. You can download my programming app that is TechMS which is available on Google Play. Thank you for watching this video.