Tampilkan postingan dengan label Puzzles. Tampilkan semua postingan
Tampilkan postingan dengan label Puzzles. Tampilkan semua postingan

Sabtu, 24 Juli 2010

Logic Program in C



#include<stdio.h>
#include<conio.h>

void main()
{
static int a[10][10],c[10][10];
int i,j=0,k,l,b=0,d=0;
clrscr();
for(i=4;i>=0;i--)
{
l=5-i;
for(j=0,k=8;l>0;l-,k-,j++)
{
a[b][j]=i;
a[b][k]=i;
}
b++;
}
for(i=0;i<4;i++)
{
for(j=0;j<=8;j++)
{
if(a[i][j]==0)
printf(" ");
else
printf("%d",a[i][j]);

}
printf("\n");
}
printf("000000000\n");
for(i=1;i<=4;i++)
{
l=5-i;
for(j=0,k=8;l>0;l-,k-,j++)
{
c[d][j]=i;
c[d][k]=i;
}
d++;
}
for(i=0;i<4;i++)
{
for(j=0;j<=8;j++)
{
if(c[i][j]==0)
printf(" ");
else
printf("%d",c[i][j]);

}
printf("\n");
}



getch();
}

Rabu, 16 Juni 2010

Puzzle!..Logical or Lateral Thinking!! Nice Story

Many years ago in a small Indian village,

A farmer had the misfortune Of owing a large sum of money to a village moneylender. 
The Moneylender, who was old and ugly, fancied the farmer's beautiful Daughter. So he proposed a bargain.

He said he would forgo the farmer's debt if he could marry his Daughter. Both the farmer and his daughter were horrified by the Proposal.

So the cunning money-lender suggested that they let Providence decide the matter. 

He told them that he would put a black Pebble and a white pebble into an empty money bag. Then the girl would Have to pick one pebble from the bag.

1) If she picked the black pebble, she would become his wife and her father's debt would be forgiven.

2) If she picked the white pebble she need not marry him and her father's debt would still be forgiven.

3) But if she refused to pick a pebble, her father would be thrown into Jail.

They were standing on a pebble strewn path in the farmer's field. As They talked, the moneylender bent over to pick up two pebbles. As he Picked them up, the sharp-eyed girl noticed that he had picked up two Black pebbles and put them into the bag.

He then asked the girl to pick A pebble from the bag.

Now, imagine that you were standing in the field.. What would you have Done if you were the girl? If you had to advise her, what would you Have told her?

Careful analysis would produce three possibilities:

1. The girl should refuse to take a pebble.

2. The girl should show that there were two black pebbles in the bag And expose the money-lender as a cheat.

3. The girl should pick a black pebble and sacrifice herself in order To save her father from his debt and imprisonment.
Take a moment to ponder over the story. The above story is used with The hope that it will make us appreciate the difference between lateral And logical thinking.

The girl's dilemma cannot be solved with Traditional logical thinking. Think of the consequences if she chooses

The above logical answers.

What would you recommend to the Girl to do?

Well, here is what she did ....

The girl put her hand into the moneybag and drew out a pebble. Without Looking at it, she fumbled and let it fall onto the pebble-strewn path Where it immediately became lost among all the other pebbles.

"Oh, how clumsy of me," she said. "But never mind, if you look into the Bag for the one that is left, you will be able to tell which pebble I Picked."

Since the remaining pebble is black, it must be assumed that she had Picked the white one. And since the money-lender dared not admit his Dishonesty, the girl changed what seemed an impossible situation into An extremely advantageous one.

MORAL OF THE STORY:

Most complex problems do have a solution. It is only that we don't Attempt to think.

Rabu, 28 April 2010

Cricket Puzzle -- Nice one.

Cricket Puzzle:
                         Two players are playing 94 and 94 ...they needed 7 runs to win the match at 3 balls, at last wicket ... How Can both the players complete their century ?????... think about this ... :) :)



.


.


.


.



.



.


.


.


.



.



.


.


.


.



.












My answer is :
1st ball :4 runs
2nd ball : The batsmen hits the ball and runs for 3 but in between runs one of the batsmen didn't touch the crease hence it will be counted as 2 runs and the other batsmen gets strike and first batsmen got a century.
3rd ball: Hits a six by the second batsmen get his century and wins the match!

Senin, 04 Mei 2009

PRE-SCHOOL TEST -- Funny Puzzle





Pre-school children were asked the following question:

"In which direction is the bus pictured below traveling?"





Look carefully at the picture.



Do you know the answer?



The only possible answers are "left" and "right."






Think about it






Still don't know?
Okay, I'll tell you.









The pre-schoolers all answered " right."



When asked, "Why do you think the bus is traveling in the right direction?" they answered:



"Because you can't see the door."



Feel pretty silly now, don't you?



I know
u r doing like this......





















Jumat, 01 Mei 2009

A Small puzzle -- Can U Answer IT?

Hero loves heroine , but heroine loves the villain.
But villain loves hero's sister,and hero's sister loves heroine's brother .
Here, heroine's brother loves villain's sister .
But villain's sister loves hero's brother.



Again!, hero's brother is also interested in heroine , and you already know that heroine loves villain.

Finally two people commit suicide.
Who're they?
---


---



---


---
---


---
---


---

 Producer and the Director!!

--
------------------------------------------------------------------
Love begins with a smile...!
Endures with happiness... !
And dies with a tear...!!


If you fill your heart with regrets of yesterday and the worries of tomorrow, You have no today to be thankful for......
For every minute you are angry with someone, You lose 60 seconds of happiness that you can never get back.