programming puzzlesWrite a "Hello World" program in 'C' without using a semicolon.
(this is tricky)
C/C++ : Exchange two numbers without using a temporary variable.
(somehow classic way)
C/C++ : Find if the given number is a power of 2.
(somehow classic way)
Write a program whose printed output is an exact copy of the source. Needless to say, merely echoing the actual source file is not allowed.
(a bit hard to think)
source: http://developers.slashdot.org/article.pl?sid=04/12/04/0116231
interesting... let me try 1&2...
1.
#include <stdio.h>
void main() {
if (printf("hello world\n")) {}
}
2.
a=a+b;
b=a-b;
a=a-b;
#include <stdio.h>
void main() {
if (printf("hello world\n")) {}
}
2.
a=a+b;
b=a-b;
a=a-b;