You are on page 1of 3

//‫نيرمين عبدالقدوس احمد المدني‬

//120200632004
#include<iostream.h>
#include<conio.h>
main()
{
const int s=7;
int i,x;
int ar1 [s];
cout<<"enter 7 number "<<endl;
for(i=0; i<s; i++ )
{
cin>>ar1[i] ;
}
cout<<"ar1= ";
for(x=0;x<s; x++ )
cout<<"\t"<<ar1[x];
////////////////////////////////////
cout<<endl;
cout<<"ar2= ";
int z,y;
int ar2[s];
for(z=0; z<s; z++ )
ar2[z]= ar1[s-z] ;
for(y=1; y<=s; y++)
cout<<"\t"<<ar2[y];
////////////////////////////////////
cout<<endl;
cout<<"ar3= ";
int m;
int ar3[s];
int temp1=ar1[s-1];
for(m=0 ;m<s-1 ;m++)
{

ar3[m]=ar1[m]+((ar1[m+1])/2);
cout<<"\t"<<ar3[m];
}
cout<<"\t"<<temp1;
///////////////////////////////////
cout<<endl;
cout<<"ar4= ";
int n;
int ar4[s];
int temp=ar1[0];
cout<<"\t"<<temp;
for(n=1; n<s; n++ )
{
ar4[n]= (ar1[n]+(n*n))-((ar1[n-1])/2) ;
cout<<"\t"<<ar4[n];

}
getch();

You might also like