#include<iostream.h>
#include<conio.h>
void main()
{
int *a,*p[50],n,i;
clrscr();
cout<<"enter the size of array ";
cin>>n;
cout<<" enter the elements of array";
for(i=0;i<n;i++)
{
cout<<"\na["<<i<<"]= ";
cin>>*(a+i);
p[i]=(a+i);
}
clrscr();
cout<<" entered elements are :";
for(i=0;i<n;i++)
{
cout<<"\naddress "<<p[i];
cout<<" "<<(a++);
}
cout<<"\n\n";
for(i=0;i<n;i++)
{
cout<<"\naddress "<<p[i]<<"\n value is "<<*(*(p+i));
}
getch();
}
OUTPUT:
#include<conio.h>
void main()
{
int *a,*p[50],n,i;
clrscr();
cout<<"enter the size of array ";
cin>>n;
cout<<" enter the elements of array";
for(i=0;i<n;i++)
{
cout<<"\na["<<i<<"]= ";
cin>>*(a+i);
p[i]=(a+i);
}
clrscr();
cout<<" entered elements are :";
for(i=0;i<n;i++)
{
cout<<"\naddress "<<p[i];
cout<<" "<<(a++);
}
cout<<"\n\n";
for(i=0;i<n;i++)
{
cout<<"\naddress "<<p[i]<<"\n value is "<<*(*(p+i));
}
getch();
}
OUTPUT:
No comments:
Post a Comment