Write a program using array and swap first and last value of array.
# include<iostream>
using namespace std;
main()
{
int a[100],i,n,temp;
cout<<"Enter element of Array you want to insert "<<endl;
cin>>n;
for(i=0;i<n;i++)
{
cout<<"Enter the element "<<i+1<<endl;
cin>>a[i];
}
temp=a[0];
a[0]=a[n-1];
a[n-1]=temp;
cout<<"After the swaming the Array Are "<<endl;
for(i=0;i<5;i++)
cout<<a[i]<<endl;
return 0;
}
0 on: "Write a program using array and swap first and last value of array."