Monday 15 October 2012

C Test

I have my first assessment test today on the C programming language. ("You're wearing a nice pair of brown trousers, Mr Lemon!!").

Also, the K&R book, The C Programming Language by Brian Kernighan and Dennis Ritchie, is available next month from Pearson in eBook formats. A classic!

Oooo, here's a little puzzle for those of you who are C/C++/C#/Java developers. What's the output of the following:

int x = 10;
int y = 10;

printf("The value of x is %d and x++ is %d\n", x, x++);
printf("but the value of y is %d and ++y is %d\n", y, ++y);

Update: Got bowled a few fast ones but managed to field them quite well (I think!)

No comments:

Post a Comment