Wednesday, September 17, 2008

Programming puzzle - 2

int main()
{
   if(condition)
   {
      printf("Hello!");
   }
   else
   {
      printf("mbvreddy");
   }
   return 0;
}

Write the condition in the above program such that output would be "Hello!mbvreddy"

Monday, September 15, 2008

Math Trick - 1

1. Grab a calculator. (you won't be able to do this one in your head)
U CAN USE THE CALCULATOR IN UR COMPUTER...

2. Key in the first six digits of your mobile number

3. Multiply by 80

4. Add 1

5. Multiply by 250

6. Add the last 4 digits of your phone number

7. Add the last 4 digits of your phone number again.

8. Subtract 250

9. Divide number by 2

Do you recognize the answer... Huh..!!

Saturday, September 13, 2008

Programming Puzzle - 1

int main()
{
   int i,n=20;
   for(i=0;i<n;i--)
      printf("*");
   return 0;
}

Change/add only one character in the above program and print '*' exactly 20 times..