Month: April 2017 →
Page 2 of 8

C# For Loop

In this article i am explaining about for loop in C#. for loop is very  powerful loop construct in C#. It is easy to use. for loop includes all three characteristics as initialization, termination and increment/decrement in a single line. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace For_Loop_Example {     class Program     {         static […]

Continue Reading →
 

Structure (C#)

In this article i am explaining about structure.Structure is the value type data type that can contain variables, methods, properties, events and etc. It simplifies the program and enhance performance of code in C# programming. The structure encapsulate small group of related variables inside a single user-defined data type. It improves speed and memory usage […]

Continue Reading →
 

C# Enumeration

Enumeration use for to assign multiple constant integral values to a single variable. Enumeration improves code clarity and makes program easier to maintain easy way. Enumeration in C# also provides more security by better error-checking technology and compiler warnings. An enumeration can be defined using enum keyword. In enumeration, you can define special set of […]

Continue Reading →
 

C# Lock Statement

In this article i am explaining about lock statement in c#. The lock statement handle lock segment as a critical section and lock the object during the execution of program from other thread. Once the execution is completed it releases the lock and frees objects. Example: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace […]

Continue Reading →
 

C# Unchecked Statement

In this article i am explaining about Unchecked key word. The unchecked statement ignores the stack overflow exception and executes the program so, the output can be incorrect. Example: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Unchecked_Statement {     class Program     {         static void Main(string[] args)         {             int n;             // assign maximum value             n = int.MaxValue; […]

Continue Reading →
 

C# Checked Statement

In this article about checked statement. The checked statements force fully C# to raise exception whenever underflow or stack overflow exception occurs due to integral type arithmetic or conversion issues. Example: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CheckedStatementExample {     class Program     {         static void Main(string[] args)         {             int n;             // assign maximum […]

Continue Reading →
 

C# Throw Statement

In this article i am explaining about Throw Exception. Throw statement is used for throwing exception in a program. The throwing exception is handled by catch block. Example: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Throw_Statement_Example { class Program { static void Main(string[] args) { int n1, n2, result; Console.WriteLine(“Enter First Number”); n1 […]

Continue Reading →