#include <iostream>
using namespace std;
int main () {
// a)
cout << "a) ";
int x = 10, y = 20;
cout << "x = 10 and y = 20 -> x++ + ++y = " << x++ + ++y << endl;
// b)
cout << "b) ";
x = 10, y = 20;
cout << "x = 10 and y = 20 -> x++ - ++y = " << x++ - ++y << endl;
// c)
cout << "c) ";
x = 10, y = 20;
cout << "x = 10 and y = 20 -> ++x + y++ = " << ++x + y++ << endl;
// d)
cout << "d) ";
cout << "for (int x = 0; x < 10; x++) cout << x; --> ";
for (x = 0; x < 10; x++) {
cout << x;
}
// e)
cout << "\ne) ";
cout << "for (int x = 0, y = 3; x < 2 * y; x++, y--) cout << x; --> ";
for (x = 0, y = 3; x < 2 * y; x++, y--) {
cout << x;
}
return 0;
}
Comments
Leave a comment