Docsity

C++ Program to Reverse the Contents of an Array, Exercises of Data Structures and Algorithms

Partial preview of the text

Download C++ Program to Reverse the Contents of an Array and more Exercises Data Structures and Algorithms in PDF only on Docsity!

#include<conio.h> #include<iostream.h> void main (void) { int a[10]={1,2,3,4,5,6,7,8,9,10}; int b[10]; int p,q; clrscr(); p=&a[0]; q=&b[9]; for (int i=0;i<10;i++) { q=p; p++; q--; } for (i=0;i<10;i++) { cout<<" "<<b[i]; } getch(); }

docsity.com