### Magic Age Cards: Age Prediction Trick

Tell the age of people (between 1 and 63) from the cards they pick.

An easy prediction trick that you can carry around in your wallet. Just print out the cards. This easy magic trick is quite baffling. The secret, once you know it, is as easy as adding one, two, three..... And this works one hundred percent of the time.

This 'trick' actually is very old but it is still performed even to this day. Usually, the six groups of numbers are written down on six cards referred as the age cards to guess someone's age, provided that the person is not over 63 years of age. Sorry any 64 yrs old or above, but you will just have to lie about your age for this one.

Some traditional magic age cards forgo the numbers 61, 62 and 63 (so that only 29 or 30 numbers per card are required, which are printed in a 5 by 6 pattern, with or without a star in the 30th position).  Full-range cards (with 32 numbers printed on each card) are more satisfying.
Here are those 6 cards:

 32  33  34  3536  37  38  3940  41  42  4344  45  46  4748  49  50  5152  53  54  5556  57  58  5960  61  62  63 16  17  18  1920  21  22  2324  25  26  2728  29  30  3148  49  50  5152  53  54  5556  57  58  5960  61  62  63 08  09  10  1112  13  14  1524  25  26  2728  29  30  3140  41  42  4344  45  46  4756  57  58  5960  61  62  63 04  05  06  0712  13  14  1520  21  22  2328  29  30  3136  37  38  3944  45  46  4752  53  54  5560  61  62  63 02  03  06  0710  11  14  1518  19  22  2326  27  30  3134  35  38  3942  43  46  4750  51  54  5558  59  62  63 01  03  05  0709  11  13  1517  19  21  2325  27  29  3133  35  37  3941  43  45  4749  51  53  5557  59  61  63

Here's how the trick looks:

You place the six cards on the table. Each of these cards has different numbers printed on them. You ask your volunteer to look at the cards and just point to the cards that have their age on them. You can straight away tell them what their age is.

The Secretis very easy. You just need to add up the lowest numbers on each card pointed to by the volunteer and these will add up to the volunteer's age. The lowest numbers are always the top left number on each card, so it is a very easy matter to do a quick calculation. For example:

If the age the volunteer select is 22; that number (22) only appears on the following cards:

1.  The card with 16 in the upper left hand position (also smallest number printed on it).
2.  The card with 2 in the upper left hand position (also smallest number printed on it).
3.  The card with 4 in the upper left hand position (also smallest number printed on it).
16 + 2 + 4 = 22

Try it out and you'll see how easy this trick is.

You can bring more twist on it. Have a spectator merely think of a family member or friend whose age is between 1 and 63. They must know the age of that person. Point to the individual cards, one at a time and ask, "Is the age of the person that you are thinking about on this card?" After examining all six cards, you tell them the age of the person.

If they say, "No, the age is not on the card", do nothing and go on to the next card. For the cards that they say "Yes!" You must keep a silently remembered, running total, of all of the numbers in the upper left-hand position of those cards. The total sum that you silently arrive at, after they look at all six cards, will be the age of the person, of whom they are thinking.

If they select 61, the number 61 appears on the following cards:

1.  The card with 16 in the upper left hand position (smallest number printed on it).
2.  The card with 8 in the upper left hand position (smallest number printed on it).
3.  The card with 1 in the upper left hand position (smallest number printed on it).
4.  The card with 4 in the upper left hand position (smallest number printed on it).
5.  The card with 32 in the upper left hand position (smallest number printed on it).
16 + 8 + 1 + 4 + 32 = 61

Of course you don't always have to use people's age. Simply ask them to pick any number below 64 and point to the cards where the number appears. You call the exact number!
(If you do it this way, it's better to get them to write their number on a slip of paper first. This way, when you predict their chosen number, they cannot mess up your trick by claiming it was not their number, as you now have the proof written down).

NOTE: If you look at the numbers in the upper left hand corner of each card, you will see that they run in a sequence, if you order them. The sequence is: 1, 2, 4, 8, 16, 32. By adding these numbers together in different combinations (and permutations) you can arrive at any number between 1 and 63. However, you can shuffle or re-arrange the numbers at your wish keeping the numbers of each card same, but remember the lowest number on each card.

### C Questions

C Questions
C Questions

Note : All the programs are tested under Turbo C/C++ compilers.
It is assumed that,
Programs run under DOS environment, The underlying machine is an x86 system, Program is compiled using Turbo C/C++ compiler.
The program output may depend on the information based on this assumptions (for example sizeof(int) == 2 may be assumed).
Predict the output or error(s) for the following:

void main()
{
int const * p=5; printf("%d",++(*p));
}
Compiler error: Cannot modify a constant value.
Explanation:
p is a pointer to a "constant integer". But we tried to change the value of the "constant integer".
main()
{
char s[ ]="man"; int i;
for(i=0;s[ i ];i++)
printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]);
}
aaaa nnnn
Explanation

### Zoho Interview | Set 1 (Advanced Programming Round)

Third Round: (Advanced Programming Round) Here they asked us to create a “Railway reservation system” and gave us 4 modules. The modules were:
1. Booking
2. Availability checking
3. Cancellation
4. Prepare chart
We were asked to create the modules for representing each data first and to continue with the implementation phase.

My Solution :