Tr!cky ‘C’ M@cros

•December 21, 2009 • Leave a Comment
#include <stdio.h>
#define f(a,b) a##b
#define g(a)   #a
#define h(a)   g(a)
  int main()
  {
          printf("%s\n",h(f(1,2)));
          printf("%s\n",g(f(1,2)));
          return 0;
  }
H! fnds try to give the output of the above pgm with ur xplanations..

Solve this Quine

•October 19, 2009 • Leave a Comment

Predict the output of this code snippet

#include <stdio.h>
char *p=”#include %c%c char *p=%c%s%c; %c%c void main(){%c%c printf(p,13,10,34,p,34,13,10,13,10,13,10,13,10); %c%c }”;
void main()
{
printf(p,13,10,34,p,34,13,10,13,10,13,10,13,10);
}

Frnds this is qn is simple.. I need ur answer with a proper xplanation.

$ecret Document$

•September 22, 2009 • Leave a Comment

A businessman in one city needs to send secret documents to his business associate in another city.There are spies trying to get hold of these documents. The documents need to be sent in a case. If the documents are sent in an unlocked case then the documents will be stolen. Anything else in an unlocked case will also get stolen. Both of them have many locks and many cases. Neither of them has the keys to the other person’s locks. How does the businessman send the documents?

Frnds this is a tricky one.. Try thinking laterally else this qn is gonna kill u guys….

Crossing the desert

•September 22, 2009 • 2 Comments

You have to cross a large desert that is 1,000 km long. You have a horse and 3,000 apples. The horse can carry a maximum of 1,000 apples at any time. For every kilometer that the horse needs to travel, it eats one apple before it can start moving. What is the maximum number of
uneaten apples that the horse can transport to the other end of the desert?

Try 2 solve this.Mail me for more info..

Will u decrypt th!$ ??

•September 10, 2009 • 2 Comments

33 444 66 7777 8 33 444 66

Try to get some valid data from the above..

Cubes

•July 30, 2009 • 4 Comments

Cube2A corporate businessman has two cubes on his office desk.

Every day he arranges both cubes  so that the front faces show the current day of the month.

What numbers are on the faces of the cubes to allow this?Note: You can’t represent the day “7″ with a single cube with a side that says 7 on it.

You have to use both cubes all the time. So the 7th day would be “07″.

Mail me if u hav ny doubt. I will publish the answer asap.

Easter Eggs-Winxp

•July 24, 2009 • Leave a Comment

# An Indian discovered that nobody can create a FOLDER named as “CON” in XP os. When questioned, microsoft guys were not able to explain but somehow made everyone believe that “CON” is short for “CONsole”. We can’t create a folder named con because it is a DEVICE NAME! Same to com1 or com2. But strange thing is even folder named “PRN” cannot be created .At Microsoft the whole Team, couldn’t answer why this happened even now it is a mystery!

#There r 2 more strange stuff with notepad.Linux_XP

1)Open an empty notepad file
2.) Type “Bush hid the facts” (without the quotes)
3.) Save it as whatever you want.
4.) Close it, and re-open it.

As u can see all characters are hidden.Any sentence with 4 words and 4-3-3-5 being no of letters in each word the result will be the same. How wierd it is?

#1. open notepad
2. write ‘.LOG’ (without quotes)
3. save the file (not SAVE AS, just plain save), any name is valid
4. close the file
5. open it

you’ll notice windows has inserted an entry containing hour and date.

#There is a strange stuff with Windows word too.

Open Microsoft Word and type  “=rand (200, 99)” without quotes and press enter.

Where did you get that from?

Similarly there are plenty of such wierd stuffz about windows which are still unanswered.

Blank cd

•June 17, 2009 • 2 Comments

There is a blank cd. You are given two colours of paint, say black and white . A sensor can recognize the colour painted on the disc and produce an output. Paint the disc in a way such that you can find the direction of rotation by looking at the output.

Please try to solve this problem.If not I’ll mail u guyz later.

Red balls & Green balls

•June 17, 2009 • 2 Comments

Bag A has 10 Red balls and Bag B has 10 Green balls.

Shuffle bag A move three balls from A to B then
Shuffle bag B move three balls from B to A

Which bag is likely have more number of balls of other color.

Note: Solution is simple if u need help mail me.

Min & Max in an @rr@y

•June 15, 2009 • Leave a Comment

You have given an array. Find the maximum and minimum numbers in less number of comparisons.

Note : Its is quite simple for all to find in 2*n comparisons can u do it in less than 2*n comparisons?

Solution