What does the following code prints out ? int y = 1; for (int x=-2; x < 8; x = x
ID: 3769016 • Letter: W
Question
What does the following code prints out ?
int y = 1;
for (int x=-2; x < 8; x = x+2) {
y = x / y;
cout << y << " & ";
}
cout << " x=" << x;
int x = 5;
do {
if ( x % 2 == 0) x -= 2;
else x++;
cout << x << " + ";
} while (x >= 2 || x == -2);
int fun (int& x, int y, int z) {
x += (x + z);
y = 22;
cout << x << y << z; return 5;
}
int main( ) {
int x = 1, y = 7, &z = y;
z = fun(x, y, z);
cout << x << y << z;
}
char x[] = “ELET2300”; // ‘A’=65, ‘0’= 48
cout << x;
cout << x[1];
x[2] = x[5] + 1;
cout << x[2];
x[3] += 1;
cout << x;
cout << x[1] + x[4];
Explanation / Answer
this program does not compile because the syntax you are using for your program is wrong.
It is giving complier error.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.