Programming Puzzles Call a method without calling it -Programming Puzzles Can you come up with a way to get a particular method executed, without explicitly calling it? The more indirect it is, the better. Here's what I mean, exactly (C used just for exemplification, all languages accepted): // Call this. void the_function(void) { printf("Hi there!\n&...
Programming Puzzles (x == x+2) make it equal for x - Programming Puzzles Define value of x in such a way that the expression (x == x+2) would evaluate to true. No rule for this programming puzzle. Solutions Jump to C, CSharp, JavaScript, PHP Solution. You can submit your own solution in comment section in same/different programming language. If your solution is...
Programming Puzzles Sing Happy Birthday to your favourite programming language - Programming Puzzles Your favourite programming language has just had a birthday. Be nice and sing it the Happy Birthday song. Of course you should accomplish this by writing a program in that language. The program takes no input, and writes the following text to the standard output or an arbitrary file: Happy...
Programming Puzzles Unix cat program - Programming Puzzles One of the most common standard tasks is to implement a "cat program [http://esolangs.org/wiki/Cat_program]": read all of STDIN and print it to STDOUT. While this is named after the Unix shell utility cat. Task * You should write a full program which reads the...
Programming Puzzles 1, 2, 3, 4, 5, Shaggy - Programming Puzzles This is a game where you must count to number from 0 to 1000. However, if the number has a 6 in it, or is divisible by 6, you don't say the number. Instead, you say "Shaggy". Rules: * You can't hard-code the numbers. * The...
Programming Puzzles C Program to print "hello world" without semicolon - Programming Puzzles We can print "hello world" or anything else in C without using semicolon. There are various ways to do so: 1. Using if 2. Using switch 3. Using while loop etc. 1. Using if Let's see a simple c example to print "hello world"...
Programming Puzzles C Program without main() function - Programming Puzzles We can write c program without using main() function. To do so, we need to use #define preprocessor directive. The C preprocessor is a micro processor that is used by compiler to transform your code before compilation. It is called micro preprocessor because it allows us to add macros. A...
Programming Puzzles Find Anagram String - Programming Puzzles Given two strings, work out if they both have exactly the same characters in them. Example Input word, wrdo This returns true because they are the same but just scrambled. Input word, wwro This returns false. Rules Here are the rules! * Assume input will be at least 1 char long,...
Programming Puzzles Best golfing (tips and tricks) in C - Programming Puzzles What general tips do you have for golfing(tips and tricks) in C? 1. Use bitwise XOR or - minus sign to check for inequality between integers: * if(a^b) instead of if(a!=b) save 1 character. * if(a-b) instead of if(a!=b) also save 1 character. --------------------------------------------------------------------------------...
Programming Puzzles Build a Rocket - Programming Puzzles This isn't rocket science. LoL Write a program or function that takes in a single-line string. You can assume it only contains printable ASCII. Print or return a string of an ASCII art rocket such as | /_\ |I| |N| |D| |I| |A| |_| /___\ VvV with the input string written from...