I have used CodeBlocks compiler for debugging purpose. But you can use any C++ programming language compiler as per your availability.
#include <iostream>
using namespace std;
int main() {
int arr[5],i;
int *p=arr;
cout<<"Enter five numbers separated by space:";
cin>>*p>>*(p+1)>>*(p+2)>>*(p+3)>>*(p+4);
cout<<"Your entered numbers in reverse order are:\n";
for(i=4;i>=0;i--)
cout<<*(p+i)<<endl;
return 0;
}
I have used CodeBlocks compiler for debugging purpose. But you can use any C++ programming language compiler as per your availability.
Result:
Enter five numbers separated by space:1 2 3 4 5
Your entered numbers in reverse order are:
5
4
3
2
1
need an explanation for this answer? contact us directly to get an explanation for this answer