Click Here to see the problem detail.

Solution

multiply n by 567,then divide the result by 9 =n*567/9=n*63. Now a question may arise why this simplification is needed? Ans: If  n*567/9 is written then n*567 will be evaluated then this result will be divided by 9. but n*567 will produce a large value when the value of n is large. This large value will cause overflow error or give wrong output.

Source Code

 


Next Previous