Why does the “System.ArgumentOutOfRangeException” error occur?
Closed due to the fact that off-topic participants Vadim Ovchinnikov , αλεχολυτ , ermak0ff , kmv , BadCatss Mar 13 '17 at 17:31 .
It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:
- “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - Vadim Ovchinnikov, αλεχολυτ, ermak0ff, kmv, BadCatss
2 answers
rounding up to fifty one digits? ( k value in the picture 51 )
https://msdn.microsoft.com/en-us/library/75ks3aby(v=vs.110).aspx -
ArgumentOutOfRangeException - digits is less than 0 or greater than 15.
(number of digits less than 0 or greater than 15)
In the Math.Round method, the second number means the number of digits (digits after the decimal point) to which the number should be rounded. This method can have only one to fifteen. As I see, the answer is entered through the console, so you need to use catch {} and try {} to prevent the user from entering unwanted digits.

Console.ReadLine()- Ev_Hyper instead ofConsole.Read()kin the picture51- IgorDecimal- 28: msdn.microsoft.com/en-us/library/zy06z30k(v=vs.110).aspx - Igor