Recent

Comments

Follow us on Facebook

Monday 1 January 2018

Write a program using array and swap first and last value of array.

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."

Write a program, that takes 16-Elements in Two-Dimensional-Array that has 4 rows & 4 columns, then display the diagonal of Matrix.

Write a program, that takes 16-Elements in Two-Dimensional-Array that has 4 rows & 4 columns, then display the diagonal of Matrix. ...

propeller ads

PropellerAds