Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

All Questions

19
votes
27answers
2k views

8 ought to become Infinity [closed]

Let's take a look on a typical loop, which usually performs 8 iterations: for (int x=0; x<8; ++x); You have to make it infinite! It's a popularity-contest ...
-7
votes
2answers
224 views

Unique multiplication by ten [closed]

People, it's a popularity contest, you have to do somthing cool here. Think about cool ways of breaking the code in most languages, not about validating for everyting! Initially this challenge ...
8
votes
36answers
4k views

Calculate the square of an integer with restrictions [closed]

The Puzzle You have to write a program or function p(n) that returns the square of what is entered into it and you may assume that the input is a non-negative integer. Put in simpler terms, return n2....
85
votes
132answers
42k views

Loop without 'looping' [closed]

A question similar to this has been asked a couple of years ago, but this one is even trickier. The challenge is simple. Write a program (in your language of choice) that repeatedly executes code ...
4
votes
7answers
2k views

Not-endless Recursion without a base case [closed]

Write a recursive function/program, to calculate either the Factorial or the Fibonacci number of a given non-negative integer, without explicitly implementing the base case(s). Your program/function ...
3
votes
21answers
4k views

Print 123454321 without if statements and using only 2 variables [closed]

The challenge: Write a function, that delivers following output: "1 2 3 4 5 4 3 2 1". Kids stuff? Of course. But here's the point: You only can use: 1 for loop, 2 int variables. You must not use: IF ...
3
votes
6answers
2k views

print “Hello, world!” without using literals [closed]

Write a program that prints "Hello, world!" without using any kinds of literals. Don't use string literals, numeric literals, byte literals, char literals, etc. Default values are allowed in ...
54
votes
7answers
7k views

Duct tape can fix Mother's Day

Based on the Duct tape can fix anything question, that was too broad, with very similar rules. Only this time the objective is very specific: The challenge Your mission is to make a program that ...
13
votes
1answer
2k views

Duct tape can fix anything [closed]

Overview This challenge was inspired by this StackOverflow Meta post. In it, @hakre says: I've seen a project really written by Stackoverflow (a noob copies together from SO here and SO there), ...
5
votes
1answer
826 views

Let us create a sonnet quine! [closed]

There are programs that will output its source code to standard output and do nothing else. They also access no external output. This type of program is known as a quine, and is a common code ...
43
votes
52answers
8k views

Alphanumeric Hello World [closed]

Your goal is to write "Hello, World!" (minus the quotes). This is a popularity-contest, so most up votes wins. Code length will be used to break ties. Anything goes, as long as it is within the ...
14
votes
57answers
17k views

Write a function that takes (x, y) and return x to the power of y WITHOUT Loops [closed]

This is a really neat short challenge. Write a function or a procedure that takes two parameters, x and y and returns the ...
15
votes
26answers
4k views

“Hello world!”, repeating each character n times [closed]

In your language of choice, write a program that outputs exactly Hello world!. Each character in your program must be repeated n times - you choose n. For example, ...
27
votes
9answers
3k views

Hello world! with NO repetition

In any programming language that existed before this question was asked, write a program (not a function) that outputs the characters Hello world! followed by a ...
79
votes
71answers
15k views

Hello world! with limited character repetition

In a language of your choice, write a program that exactly outputs the characters Hello world! followed by a newline. The code: should not use any character more ...
25
votes
17answers
8k views

Print 1 to 1000 in C++ without semi-colons

Following this popular question, present your solution which prints the numbers 1 to 1000 (all of them, not the string "1 to 1000" verbatim or something funny) in C++ without using any semi-colons. ...