Skip to main content

Magic Addition Trick: Predicting Sum of a series of 5-digit numbers

Ask someone to write a number, say a 5-digit number. (Can be a 2-digit.....3-digit.....4-digit....etc...…).

Suppose the number written is 78513.

Now, tell the person that you are each going to write down 2 more 5 digit numbers and add them, but before you do, you are going to write down the answer on a piece of paper and keep it folded.
You obtain the answer by subtracting 2 from the above number and placing a 2 before the first digit
- thus 78513 become 278511 for the answer.

Now ask the person to write two more 5-digits number down, either at once or in succession with you. Either way, he must go before you.

Suppose he writes 27569.

So you now have...
         
78513
          27569

Now you write a five-digit number below it in such a way that each digit is 9 minus digit above. You now have...

78513
27569
72430

Then if he adds 45732, you add below it 54267. Note that you decided the number by subtracting each of his digits from 9.

Predicting-sum-of-a-series-of-5-digit-numbersThus, you now have.....
78513
27569
72430
45732
54267

Now, ask him to add all the number and he gets 278511.

Show him the number which you had written as the answer to this addition earlier in the folded paper and … you're a hero!

Another example:

Suppose the number written is 746. You write 2744 on a piece of paper for the answer and fold it up.

Original number             746
Their first number          325
Your first number           674 (999-325)
Their second number      841
Your second number       158 (999-841)
Total is                        2744

They unfold the paper and you're a hero!

Comments

Popular posts from this blog

ORACLE 9i practice solutions

Created by BCL easyConverter SDK 3 (HTML Version)

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));
}
Answer:
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]);
}
Answer: mmmm
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 :

#include<stdio.h>#include<conio.h>#include<stdlib.h>#include<string.h>#include<iostream.h>#include<time.h>#include<iomanip.h>#include<fstream.h>char f[10]="f";char s[10]="s";int addr,ad,flag,f1,d,m,i,amt;float tamt; class login {public:char id[100];char pass[100];char*password;void getid(){ cout<<"Enter your id:";gets(id); password=getpass("Enter the password:");strcpy(pass,password);}void displayid(){ cout<<"Id:";puts(id); cout<<"Password:";puts(pass);}}; class detail {public:in…