Declare int and use it in CSharp

Description

The following code shows how to declare int and use it.

Example


using System;//from   w  ww.ja  v  a2s.c  o  m

public class MainClass {
   public static void Main(string[] args) {
      int number1 = 12;
      int number2 = 23;
      Console.WriteLine("The answer is " + number1 + number2);

      Console.WriteLine("The answer is " + (number1 + number2));
      
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Data Types »




C# Data Types
Bool
Byte
Char
Decimal
Double
Float
Integer
Long
Short
String
C# Array
Array Example
Byte Array
C# Standard Data Type Format
BigInteger
Complex
Currency
DateTime
DateTimeOffset
DateTime Format Parse Convert
TimeSpan
TimeZone
Enum
Null
tuple
var