//Programme for print array element in revarse order using pointer
#include<iostream>
using namespace std;
int main()
{
cout<<"enter first 10 no.\n";
int a[10],*p;
p=a;
for(int i=0;i<10;i++)
{
cin>>*(p+i);
}
cout<<"reverse elements of array is.\n";
for(int i=9;i>=0;i--)
{
cout<<*(p+i)<<endl;
}
}
#include<iostream>
using namespace std;
int main()
{
cout<<"enter first 10 no.\n";
int a[10],*p;
p=a;
for(int i=0;i<10;i++)
{
cin>>*(p+i);
}
cout<<"reverse elements of array is.\n";
for(int i=9;i>=0;i--)
{
cout<<*(p+i)<<endl;
}
}
No comments:
Post a Comment