Just for fun (C# and C++)...time yourself [closed]
- by Ted
Possible Duplicate:
What is your solution to the FizzBuzz problem?
OK guys this is just for fun, no flamming allowed !
I was reading the following
http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html
and couldn't believe the following sentence...
" I've also seen self-proclaimed senior programmers take more than 10-15 minutes to write a solution."
For those that can't be bothered to read the article, the background is this:
....I set out to develop questions that can identify this kind of developer and came up with a class of questions I call "FizzBuzz Questions" named after a game children often play (or are made to play) in schools in the UK. An example of a Fizz-Buzz question is the following:
Write a program that prints the
numbers from 1 to 100. But for
multiples of three print "Fizz"
instead of the number and for the
multiples of five print "Buzz". For
numbers which are multiples of both
three and five print "FizzBuzz".
SO I decided to test myself. I took 5 minutes in C++ and 3mins in c#!
So just for fun try it and post your timings + language used!
P.S NO UNIT TESTS REQUIRED, NO OUTSOURCING ALLOWED, SWITCH OFF RESHARPER! :-)
P.S. If you'd like to post your source then feel free