Question: / / functions prototypes static int x = 1 ; int y = x * 2 ; int main ( ) { vector vec 1

// functions prototypes
static int x =1;
int y = x *2;
int main(){
vector vec1{1,3,5,7,9,11,13,15};
vector vec2{0,2,4,6,8,10};
vec1.swap(vec2);
int* ptr = &vec2[7];
y =*(ptr -2);
t1();
t2();
t3();
t3();
t4();
return 0;
}
void t1(){
cout <<"x: "<< x <<"| y: "<< y << endl;
y -=8;
x +=-1;
}
void t2(){
int& x = y;
x += ::x++;
cout <<"x: "<< x <<"| y: "<< y << endl;
}
void t3(){
int y = x;
static int x =2;
cout <<"x: "<< x +1<<"| y: "<< y +2<< endl;
x += y;
}
void t4(){
int y = x + ::x;
int& z = ::y;
z +=-1;
cout <<"x: "<< x + z <<"| y: "<< y << endl;
}
This program outputs 5 lines. What are they?
1.
2.
3.
4.
5.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!