Wednesday, December 5, 2007

GCC rocks

Puzzle of the day in the office:

#include <iostream>

using namespace std;

int main() {
int j = 2;
cout << -1 * abs(j - 1) << endl;
return 0;
}

1) What does this program print?
2) What the hell is going on?

3 comments:

dfyz wrote:

Join the club.

http://jerom.livejournal.com/120844.html?nc=15
http://pg.livejournal.com/12287.html?nc=9

Aldanur wrote:

*Subscribed to PG's LJ*

Glider wrote:

Пока комменты у pg не прочел, не врубился :)
gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4)