#include<iostream.h>
#include<conio.h>
void reverse(int a[],int n);
void main()
{
clrscr();
int a[10],n,i;
cout<<"\n";
cout<<"enter size";
cout<<"\n\n";
cin>>n;
cout<<"\n\n";
cout<<"enter elements";
cout<<"\n\n";
for(i=0;i<n;i++)
{
cout<<"\n";
cin>>a[i];
}
reverse(a,n);
getch();
}
void reverse(int a[],int n)
{
int i,temp;
for(i=0;i<n/2;i++)
{
temp=a[i];
a[i]=a[n-1-i];
a[n-1-i]=temp;
}
cout<<"\n\n";
cout<<"reverse is";
for(i=0;i<n;i++)
{
cout<<"\t"<<a[i];
}
}
#include<conio.h>
void reverse(int a[],int n);
void main()
{
clrscr();
int a[10],n,i;
cout<<"\n";
cout<<"enter size";
cout<<"\n\n";
cin>>n;
cout<<"\n\n";
cout<<"enter elements";
cout<<"\n\n";
for(i=0;i<n;i++)
{
cout<<"\n";
cin>>a[i];
}
reverse(a,n);
getch();
}
void reverse(int a[],int n)
{
int i,temp;
for(i=0;i<n/2;i++)
{
temp=a[i];
a[i]=a[n-1-i];
a[n-1-i]=temp;
}
cout<<"\n\n";
cout<<"reverse is";
for(i=0;i<n;i++)
{
cout<<"\t"<<a[i];
}
}