Showing posts with label HERO OF THE DAY. Show all posts
Showing posts with label HERO OF THE DAY. Show all posts

Answer this if u can...

Friday, February 29, 2008

1) Alice and Bob are on separate islands. Bob is sick, and Alice has the medicine. Eve has a boat and a chest that can be locked. She is willing to transport objects between Alice and Bob, but only in the chest, and if the chest is unlocked, she will steal whatever is inside. If both Alice and Bob have a padlock and a key such that their own key only opens their own lock, how can Alice send Bob the medicine so that Eve won't steal it?

2) Every day, Joe arrives at the train station from work at 6pm. His wife leaves home in her car to meet him there at exactly 6pm, and drives him home. One day, Joe gets to the station an hour early, and starts walking home, until his wife meets him on the road. They get home 20 minutes earlier than usual. How long was he walking? (HINT:Distances are unspecified. Speeds are unspecified, but constant.)

Read more...

Question For the Day.

Thursday, January 31, 2008

#include
int main()
{
int a=10;
switch(a)
{
case '1':
printf("ONE\n");
break;
case '2':
printf("TWO\n");
break;
defa1ut:
printf("NONE\n");
}
return 0;
}
If you expect the output of the above program to be NONE, I would request you to check it out!!
But this is Not the question for the hero of the day. :)

Question for the HERO OF THE DAY02

I thought the following program was a perfect C program. But on compiling, I found a silly mistake. Can you find it out (without compiling the program :-) ?
Be true to yourself. Find the error without compiling and be The hero. (pretty easy i guess)

#include

void OS_Solaris_print()
{
printf("Solaris - Sun Microsystems\n");
}

void OS_Windows_print()
{
printf("Windows - Microsoft\n");

}
void OS_HP-UX_print()
{
printf("HP-UX - Hewlett Packard\n");
}

int main()
{
int num;
printf("Enter the number (1-3):\n");
scanf("%d",&num);
switch(num)
{
case 1:
OS_Solaris_print();
break;
case 2:
OS_Windows_print();
break;
case 3:
OS_HP-UX_print();
break;
default:
printf("Hmm! only 1-3 :-)\n");
break;
}

return 0;
}

Read more...

HERO OF THE DAY: 01

Tuesday, January 29, 2008

Question For the day:

You might have known two swapping techniques. 1) With a temporary variable and 2) With out the use of temporary variable.
Now the question is, Can u Come up with some new method of your own for swapping?
Answer this and be THE HERO .

Read more...

About This Blog

  © Blogger template Writer's Blog by Ourblogtemplates.com 2008

Back to TOP