In the last puzzle, user had to write the shortest code to produce 0. I have received around 700 valid answers and while reading through the answers, I had a blast. I personally learned quite a lot from just administrating the quiz. Since that puzzle, I have received quite a few emails requesting to come up with next puzzle.
Honestly, building a puzzle is very hard, but as you all wanted me to come up with another puzzle, here is the puzzle.
Puzzle: Write the shortest code to produce the number 1000000000 (One Billion)
Conditions:
1 You can use numbers in the code, but not One billion (1000000000) itself
2 You cannot use arithmetic operators
I guess, that’s it. This time, the puzzle is very simple. The shortest code which I have with me is of the total 10 characters (including spaces).
Now is the time, please get going with this puzzle and post your answers in the comments section. Please note that all the answers will be hidden till the next Monday. On the Monday morning, I will publish all the valid answers.
After finding the answer to this puzzle and if you still have time and you want to solve something more challenging here another small puzzle Select Unique Data From a Column Exist in Two Different Table, which I shared earlier last week.
Reference: Pinal Dave (https://blog.sqlauthority.com)
33 Comments. Leave new
SELECT .1e+10
select 1e9
SELECT.1e10
select 1e9
select 1e9
Hi,
SELECT CONCAT(‘1’+’000000000’)
(Though not the shortest one)
SELECT CONCAT(1000,’000′,’000′)
–pretty sure there are better ways, just want to see the answers
select POWER(10,9)
SELECT ‘1’+REPLICATE(0, 9)
SELECT REPLACE( (1999999999),’9′,’0′) or select ‘1’+ replicate(‘0’,9)
select convert(int,concat(‘1’,replicate(‘0’,9)))
select 1e9
THIS WILL PRODUCE 1 BILLION just 10 characters.
SELECT CONCAT(‘1’,REPLICATE(‘0’,9))
Power(10,9)
SELECT 10e8
My 2nd answer:
SELECT 1e9
SELECT CONCAT(‘100000000′,’0’)
SELECT POWER(10,9)
select 1e9
Some thing like SELECT POWER(10,9)