MadCow108
May 30th, 2009, 01:08 PM
hi, a little puzzle for you, I hope not all know it already:
int i, n = 20;
for (i=0; i<n; i--)
{
cout << "x" << endl;
}
find three different solutions to get this code to print out 20 times x by only replacing a single character with another single character.
No adding of characters.
Usually people find two possibilities quite quickly but the third can be tricky :)
int i, n = 20;
for (i=0; i<n; i--)
{
cout << "x" << endl;
}
find three different solutions to get this code to print out 20 times x by only replacing a single character with another single character.
No adding of characters.
Usually people find two possibilities quite quickly but the third can be tricky :)