//========================
//Program in C to display array elements by pointer, arreltbyptr.c
//========================
#include<stdio.h>
int main()
{
int i;
int arr[10]={10,11,12,14,17};
int *j;
j=&arr[0];
for(i=0;i<5;i++)
{
printf("\n array elt at position %d is: %d",i,*j);
//printf("\n array elt at position %d is: %d",i,arr[i]);
j++;
}
return 0;
}
//Program in C to display array elements by pointer, arreltbyptr.c
//========================
#include<stdio.h>
int main()
{
int i;
int arr[10]={10,11,12,14,17};
int *j;
j=&arr[0];
for(i=0;i<5;i++)
{
printf("\n array elt at position %d is: %d",i,*j);
//printf("\n array elt at position %d is: %d",i,arr[i]);
j++;
}
return 0;
}
No comments:
Post a Comment