C program to print the array element by increment a pointer

C program to print the array element by increment a pointer. When using pointers for arrays, the pointer’s data type must match the array’s data type. To get the next spot, the increment operation is performed on the pointer variable in the loop. This arithmetic applies to all array sizes. despite the fact that each data type consumes a different number of bytes

#include<stdio.h>
const int MAX = 3; 
int main()
{
int var[] = {10,20,30};
int i, *ptr;
ptr = var;
for(i = 0; i < MAX; i++)
{
printf("\n\n\nAddress of var[%d] = %d ", i, ptr);
printf("\nValue of var[%d] = %d ", i, *ptr);
ptr++;
}
return 0;
}

Address of var[0] = 457265988
Value of var[0] = 10


Address of var[1] = 457265992
Value of var[1] = 20


Address of var[2] = 457265996
Value of var[2] = 30