### Digital Root or Digital Sum of a Number and its significance

The word Digit means the single figure number; the numbers from 1 to 9 and zero.In mathematics, the digit sum of a given integer is the sum of all its digits, (e.g.: the digit sum of 84001 is calculated as 8+4+0+0+1 = 13).

The digital root (also repeated digital sum) of a number is the (single digit) value obtained by an iterative process of summing digits, on each iteration using the result from the previous iteration to compute a digit sum. The process continues until a single-digit number is reached.

To find digital root of a number, add all its digits. If this sum is more than 9, add the digits of this sum. The single digit obtained at the end is the digital root of the number.
For example, Digital Sum of 24566 is 2+4+5+6+6 = 23 = 2+3 = 5.

Notice that even though sum of the digit of 24566 is 23, 23 is not the digital sum. The sum is again added until we are left with a single digit.

Similarly, the digital root of 65536 is 7, because 6 + 5 + 5 + 3 + 6 = 25 and 2 + 5 = 7.

In other words, it is the remainder when the number is divided by 9. So for 625, the remainder is 4 because 625 ÷ 9 = 69 with a remainder of 4. The digital root is also 4 (6+2+5=13=1+3=4).

A shortcut to find digital rootCasting Out 9’s

Consider the number 19. The digital sum of 19 is 1+9 = 10 = 1. Take the number 129. The digital sum of 129 is 1+2+9 = 12 = 3. And, the digital sum of 1239 is 1+2+3+9 = 15 = 6

So, if a number has 9, this will not have any impact on the digital sum. So, we can safely ignore the digit 9 in the number.

So, can you guess the digital sum of 599992? Ignoring all the 9’s, we are left with 5 and 2. So the digital sum is 5+2=7.

Consider another example 7486352. Here, we do not have any 9’s in the number. So, in order to obtain the digital sum, we will just add all the digits.

Digital Sum of 7486352 is 7+4+8+6+3+5+2 = 35 = 3+5 = 8.

7 4 8 6 3 5 2

We can cancel all the digits, we are left with the digit 8. So, the digital sum is 8.

The Digit Sum of 549673 is 7“Cast out” the 5+49 and 6+3, leaving just 7.

By Casting Out 9’s, finding a Digit Sum can be done more quickly and mentally!

So, the question arises, why do we need to know Digital Sum of the number?

It turns out, when the numbers are added, subtracted, multiplied or divided; their digital sums will also be respectively added, subtracted, multiplied or divided. So, we can use their digital sums to check the accuracy of the answer.

Check any size number
What makes this method so easy to use is that it changes any size number into a single-digit number. You can check calculations that are too big to go into your calculator by casting out nines.

For instance, if we wanted to check 12,345,678 × 89,045 = 1,099,320,897,510, we would have a problem because most Checking Your Answers 39 calculators can’t handle the number of digits in the answer, so most would show the first digits of the answer with an error sign.

The easy way to check the answer is to cast out the nines. Let’s try it.

1 2 3 4 5 6 7 8 = 0

9 0 4 5 = 8

1 0 9 9 3 2 0 8 9 7 5 1 0 = 0

All of the digits in the answer cancel. The nines automatically cancel, then we have 1 + 8, 2 + 7, then 3 + 5 + 1 = 9, which cancels again. And 0 × 8 = 0, so our answer seems to be correct.

Let’s try another one.

137 × 456 = 62,472

To find our substitute for 137:
1 + 3 + 7 = 11
1 + 1 = 2

There were no shortcuts with the first number. 2 is our substitute for 137.
To find our substitute for 456:
4 + 5 + 6 =
We immediately see that 4 + 5 = 9, so we cross out the 4 and the 5.
That just leaves us with 6, our substitute for 456.
Can we find any nines, or digits adding up to 9, in the answer?
Yes, 7 + 2 = 9, so we cross out the 7 and the 2. We add the other digits:
6 + 2 + 4 = 12
1 + 2 = 3

Writing the substitute numbers below the actual numbers might look like this:

137 × 456 = 62,472
2        6           3

We multiply the substitute numbers: 2 times 6 equals 12. The digits in 12 add up to 3 (1 + 2 = 3). This is the same as our substitute answer, so we were right again.

Let’s try one more example. Let’s check if this answer is correct:

456 × 831 = 368,936

We write in our substitute numbers:

456 × 831 = 368,936
6         3            8

That was easy because we cast out (or crossed out) 4 and 5 from the first number, leaving 6. We cast out 8 and 1 from the second number, leaving 3. And almost every digit was cast out of the answer, 3 plus 6 twice, and a 9, leaving a substitute answer of 8.

We now see if the substitutes work out correctly: 6 times 3 is 18, which adds up to 9, which also gets cast out, leaving 0. But our substitute answer is 8, so we have made a mistake somewhere.

When we calculate it again, we get 378,936.

Did we get it right this time? The 936 cancels out, so we add 3 + 7 + 8, which equals 18, and 1 + 8 adds up to 9, which cancels, leaving 0. This is the same as our check answer, so this time we have it right.

Does this method prove we have the right answer? No, but we can be almost certain.

This method won’t find all mistakes. For instance, say we had 3,789,360 for our last answer; by mistake we put a 0 on the end.

The final 0 wouldn’t affect our check by casting out nines and we wouldn’t know we had made a mistake. When it showed we had made a mistake, though, the check definitely proved we had the wrong answer.

Again, we know from the last example, the Digital sum of 378,936 is 0 and the digital sum of 387,936 (which we might have put mistakenly) is also 0. In this case, even though the numbers are different, the Digital sum remains the same as the numbers have changed their places.

So, even digital root technique helps us in eliminating few options (if any, as in case of MCQ) from the question, it cannot conclusively point out the right answer. It is a simple, fast check that will find most mistakes, and should get you 100% scores on most of your math tests.

1. Digital root can be find by divide the the number by 9.if remainder occur 0 it means digital root is 9 except the remainder is the digital root.. ex.
num=12345
num=num%9;
digital=num
which is 6
and
if num=81
then num%9=0
so digital root is 9

1. yeah u r correct..

### 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 :