Interesting tricky program using C & C++

Here are some interesting tricky c programs that will be a brain exercise for you if you take them as challenge.

Program 1:
Create a Program which produce output "Hello World" , the program must not contains semicolon ; in other word any statement of the program will not have a termination semicolon.

Program 2:
Write a C or C++ program which run without main() function or in other word we can say the function should not have any function named main().

Program 3:
Write a C program which takes one integer number from user and then checks whether number is Even or Odd without using Modulus (%) and Division (/) operator.

Program 4:
C program which creates numeric array num and print its value like 1[num], 2[num], 3[num]...n[num] check will it run.
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #define hand ma##in
  4. int hand(int argc, char *argv[]) {
  5. if (printf("Hello, world!\n")||
  6. scanf("%d",&argc)){}
  7. if (argc&1){if(printf("Even")){}}
  8. else {if(printf("Odd")){}}
  9. while (exit(0),0[argv]){}
  10. }



If you have solutions please share them with us by commenting below..
Previous
Next Post »