C# Unchecked Statement

In this chapter you will learn:

  • What is unchecked statement in C#?
  • What is the advantage and disadvantage of Unchecked Statement?
  • How to use unchecked statement in C sharp programming?

The unchecked statement ignores the stack overflow exception and executes the program so, the output can be incorrect.


Here, the correct output should be 2147483648 but the output is -2147483648 which is wrong because of unchecked statements as it ignores exception and put output on screen.




In this chapter you learned what unchecked statement is in C# and how to use it in programming. In next chapter you will learn about Lock Statement in C#.

Leave a Reply

Your email address will not be published. Required fields are marked *