Post some interesting " find the output " type questions or any other sort of tricky programs here in c++ or java....
take the following code:
int i, n = 20;
for (i=0; i<n; i--)
{
cout << "x" << endl;
}
by changing only ONE character in the above code, meaning you cannot change 20 to 31, because you will have changed two characters, you can change 20 to 21, because you only changed the 0, do the following:
find 3 ways to make the above code print x 20 times (by changing only one character or inserting one char).
take the following code:
int i, n = 20;
for (i=0; i<n; i--)
{
cout << "x" << endl;
}
by changing only ONE character in the above code, meaning you cannot change 20 to 31, because you will have changed two characters, you can change 20 to 21, because you only changed the 0, do the following:
find 3 ways to make the above code print x 20 times (by changing only one character or inserting one char).