### Dividing numbers by 9, 99, 999 and so on

By now you know how to divide any number by 9, 90, 900and so on at an extremely fast speed simply by adding the digits of the dividend. Here is an inquisitive method to divide numbers by 9, 99, 999, 9999 and so on in the fastest way if;
1. the dividend is evenly divisible by the number consisting of only 9 (Divisor).
2. the number of digits of the divisor (9’s) is half or more than the number of digits of the dividend i.e. dividing a 4-digits number by 99 or 999, a 6-digits number by 999 or 9999 or 99999, an 8-digits number by four 9’s or more ... and so on.
The Trick:

If the above criteria are met all you need to do is:

Starting from the right-digit omit as many digits(s) of the dividend as there are in the divisor (number made up of 9’s) and then add 1 to the rest part of the dividend. That’s all. However, in case a dividend is also made up of 9 only; then add 2.
Let’s say you want to divide 8217 by 99

Notice that, 8217 is a 4-digits number which is to be divided by a 2-digit number 99.

So, omit 2 digits from the right of dividend which are 7 and 1 and the rest of dividend is 82.
Now add 1 to 82 to get (82 + 1 =) 83.

586413 ÷ 999 =?

Here the divisor (999) is 3-digit number and the dividend (586413) is a 6-digit number. And the dividend is evenly divisible by the Divisor.  So, the rule is applicable.

Now, since 999 has three digits; mentally omit three digits from the right side of the dividend i.e.413.
Rest of the dividend is 586. Now, add 1 to 586 to get the final answer 587.

So, 586413 ÷ 999 =7

7846421535 ÷ 99999 =?

As there is five 9’s divisor; omit 5 digits of the dividend from the right to get 78464.

889911 ÷ 9999 =?

Here the divisor (9999) is 4-digit number and the dividend (889911) is a 6-digit number. And the dividend is evenly divisible by the Divisor.  So, the rule is applicable.

Since 9999 has 4 digits; omit 4 digits from the dividend to get 88 and adding up 1 to 88 gives 89. So, 889911 ÷ 9999 =89.

But, 9999 ÷ 99 = 99 + 2 = 101

Similarly, 999999 ÷ 999 = 999 + 2 = 1001

1. good effort,super shortcut......!

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