- Add two numbers without using addition operator | 4 methods
- Implement power function without using multiplication and division operators
- Print all numbers between 1 to N without using semicolon
- Swap two numbers without using third variable | 5 methods
- Determine the if condition to print specific output
- Find maximum, minimum of three numbers without using conditional statement and ternary operator | 4 methods
- Find numbers represented as sum of two cubes for two different pairs
- Print “Hello World” with empty main() function | 3 methods
- Print all numbers between 1 to N without using any loop | 4 methods
- Print a semicolon without using semicolon anywhere in the program
- Multiply two numbers without using multiplication operator or loops
- Find square of a number without using multiplication and division operator | 3 methods
- Find if a number is even or odd without using any conditional statement
- Set both elements of a binary array to 0 in single line
- Find minimum number without using conditional statement or ternary operator
- Perform Division of two numbers without using division operator
- Generate 0 and 1 with 75% and 25% Probability
- Generate Desired Random Numbers With Equal Probability
- Return 0, 1 and 2 with equal Probability using the specified function
- Generate Fair Results from a Biased Coin
- Generate numbers from 1 to 7 with equal probability using specified function
- Implement Ternary Operator Without Using Conditional Expressions
- Determine if two integers are equal without using comparison and arithmetic operators
- Return 0 and 1 with equal Probability using the specified function
- Clock angle problem – Find angle between hour and minute hand
Top 25 Programming Puzzles and Brain Teasers
转自:Top 25 Programming Puzzles and Brain Teasers