...42

Locked
Bdw3
Posts: 3348
Joined: Sun Mar 12, 2000 8:00 am

...42

Post by Bdw3 »

Code: Select all

#define SIX    1 + 5
#define NINE   8 + 1

int main(void)
{
    printf( "What you get if you multiply six by nine: %d\n", SIX * NINE );
    return 0;
}
Silly computer! :lol:
Last edited by Bdw3 on Sat Apr 16, 2005 1:34 am, edited 1 time in total.
LeonardoP
Posts: 811
Joined: Fri Aug 18, 2000 7:00 am

Post by LeonardoP »

hmmm so you multiply 6, times, 9.. titillating.
Bdw3
Posts: 3348
Joined: Sun Mar 12, 2000 8:00 am

Post by Bdw3 »

6 times 9 is 54....
LeonardoP
Posts: 811
Joined: Fri Aug 18, 2000 7:00 am

Post by LeonardoP »

how come you're so sure?!
Bdw3
Posts: 3348
Joined: Sun Mar 12, 2000 8:00 am

Post by Bdw3 »

Because it is... :dork:

the above code returns 42 as the answer because it sort of borkes the order of operations, but dosen't...

1 + 5 * 8 + 1

it dosen't sum the two definitions first.
Last edited by Bdw3 on Wed Apr 13, 2005 11:39 pm, edited 1 time in total.
LeonardoP
Posts: 811
Joined: Fri Aug 18, 2000 7:00 am

Post by LeonardoP »

but you could be wrong too, you can never be sure.
LeonardoP
Posts: 811
Joined: Fri Aug 18, 2000 7:00 am

Post by LeonardoP »

don't try to trick me man, i don't like that shit
Bdw3
Posts: 3348
Joined: Sun Mar 12, 2000 8:00 am

Post by Bdw3 »

phantasmagoria
Posts: 8525
Joined: Wed Oct 22, 2003 7:00 am

Post by phantasmagoria »

BODMAS
[size=85]
Bdw3
Posts: 3348
Joined: Sun Mar 12, 2000 8:00 am

Post by Bdw3 »

:icon28:
phantasmagoria
Posts: 8525
Joined: Wed Oct 22, 2003 7:00 am

Post by phantasmagoria »

BRACKETS OVER DIVISION MULTIPLICATION ADDITION AND SUBTRATION
[size=85]
phantasmagoria
Posts: 8525
Joined: Wed Oct 22, 2003 7:00 am

Post by phantasmagoria »

bunny said so



:icon10:
[size=85]
Bdw3
Posts: 3348
Joined: Sun Mar 12, 2000 8:00 am

Post by Bdw3 »

Thought that was a horse pig... 0.o
phantasmagoria
Posts: 8525
Joined: Wed Oct 22, 2003 7:00 am

Post by phantasmagoria »

http://www.frozenreality.co.uk/comic/bunny/

horse pig? HORSE PIG?! bunny for one, was offended
Last edited by phantasmagoria on Wed Apr 13, 2005 11:44 pm, edited 1 time in total.
[size=85]
LeonardoP
Posts: 811
Joined: Fri Aug 18, 2000 7:00 am

Post by LeonardoP »

i don't believe you guys. i know for a fact that google isn't the answer.
Bdw3
Posts: 3348
Joined: Sun Mar 12, 2000 8:00 am

Post by Bdw3 »

:lol:
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Post by ^misantropia^ »

* computer nerd steps in *

1 + 5 * 8 + 1 gets evaluated as 1 + (5 * 8) + 1 == 42. This code snippet is evil. The #defines should've been written as:

Code: Select all

#define SIX    (1 + 5)
#define NINE   (8 + 1)
But it's funny. A little.

* computer nerd steps out *
Bdw3
Posts: 3348
Joined: Sun Mar 12, 2000 8:00 am

Post by Bdw3 »

:icon26:
losCHUNK
Posts: 16019
Joined: Thu May 09, 2002 7:00 am

Post by losCHUNK »

so if 9 is 4 and 4 is 9 and 3 is somewhere in afganistan, then whats 24
[color=red] . : [/color][size=85] You knows you knows [/size]
User avatar
Scourge
Posts: 15559
Joined: Mon Mar 25, 2002 8:00 am

Post by Scourge »

losCHUNK wrote:so if 9 is 4 and 4 is 9 and 3 is somewhere in afganistan, then whats 24
About the right amount of beers.
Locked